Skip to content
Snippets Groups Projects
Commit 4507da48 authored by Denis Osvald's avatar Denis Osvald Committed by Andy Green
Browse files

fixup! ipv6 move disable to vhost option

client ipv6 check vhost not context
parent c16c6c85
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ lws_client_connect_2(struct lws *wsi) ...@@ -35,7 +35,7 @@ lws_client_connect_2(struct lws *wsi)
ads = wsi->vhost->http_proxy_address; ads = wsi->vhost->http_proxy_address;
#ifdef LWS_USE_IPV6 #ifdef LWS_USE_IPV6
if (LWS_IPV6_ENABLED(context)) { if (LWS_IPV6_ENABLED(wsi->vhost)) {
memset(&server_addr6, 0, sizeof(struct sockaddr_in6)); memset(&server_addr6, 0, sizeof(struct sockaddr_in6));
server_addr6.sin6_port = htons(wsi->vhost->http_proxy_port); server_addr6.sin6_port = htons(wsi->vhost->http_proxy_port);
} else } else
...@@ -45,7 +45,7 @@ lws_client_connect_2(struct lws *wsi) ...@@ -45,7 +45,7 @@ lws_client_connect_2(struct lws *wsi)
} else { } else {
ads = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_PEER_ADDRESS); ads = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_PEER_ADDRESS);
#ifdef LWS_USE_IPV6 #ifdef LWS_USE_IPV6
if (LWS_IPV6_ENABLED(context)) { if (LWS_IPV6_ENABLED(wsi->vhost)) {
memset(&server_addr6, 0, sizeof(struct sockaddr_in6)); memset(&server_addr6, 0, sizeof(struct sockaddr_in6));
server_addr6.sin6_port = htons(wsi->u.hdr.c_port); server_addr6.sin6_port = htons(wsi->u.hdr.c_port);
} else } else
...@@ -59,7 +59,7 @@ lws_client_connect_2(struct lws *wsi) ...@@ -59,7 +59,7 @@ lws_client_connect_2(struct lws *wsi)
lwsl_client("%s: address %s\n", __func__, ads); lwsl_client("%s: address %s\n", __func__, ads);
#ifdef LWS_USE_IPV6 #ifdef LWS_USE_IPV6
if (LWS_IPV6_ENABLED(context)) { if (LWS_IPV6_ENABLED(wsi->vhost)) {
memset(&hints, 0, sizeof(struct addrinfo)); memset(&hints, 0, sizeof(struct addrinfo));
#if !defined(__ANDROID__) #if !defined(__ANDROID__)
hints.ai_family = AF_INET6; hints.ai_family = AF_INET6;
...@@ -143,7 +143,7 @@ lws_client_connect_2(struct lws *wsi) ...@@ -143,7 +143,7 @@ lws_client_connect_2(struct lws *wsi)
if (!lws_socket_is_valid(wsi->sock)) { if (!lws_socket_is_valid(wsi->sock)) {
#ifdef LWS_USE_IPV6 #ifdef LWS_USE_IPV6
if (LWS_IPV6_ENABLED(context)) if (LWS_IPV6_ENABLED(wsi->vhost))
wsi->sock = socket(AF_INET6, SOCK_STREAM, 0); wsi->sock = socket(AF_INET6, SOCK_STREAM, 0);
else else
#endif #endif
...@@ -189,7 +189,7 @@ lws_client_connect_2(struct lws *wsi) ...@@ -189,7 +189,7 @@ lws_client_connect_2(struct lws *wsi)
} }
#ifdef LWS_USE_IPV6 #ifdef LWS_USE_IPV6
if (LWS_IPV6_ENABLED(context)) { if (LWS_IPV6_ENABLED(wsi->vhost)) {
v = (struct sockaddr *)&server_addr6; v = (struct sockaddr *)&server_addr6;
n = sizeof(struct sockaddr_in6); n = sizeof(struct sockaddr_in6);
} else } else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment