diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 278a66f21..b6b864c52 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -33,6 +33,8 @@ lws_getaddrinfo46(struct lws *wsi, const char *ads, struct addrinfo **result) memset(&hints, 0, sizeof(hints)); *result = NULL; + hints.ai_socktype = SOCK_STREAM; + #ifdef LWS_WITH_IPV6 if (wsi->ipv6) { @@ -44,7 +46,6 @@ lws_getaddrinfo46(struct lws *wsi, const char *ads, struct addrinfo **result) #endif { hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; } return getaddrinfo(ads, NULL, &hints, result);