1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

socks5: fix compile breakage

https://github.com/warmcat/libwebsockets/issues/1777
This commit is contained in:
Andy Green 2019-11-27 19:19:48 +00:00
parent 8e91a0d723
commit 74712ea4f5
2 changed files with 3 additions and 2 deletions

View file

@ -1372,7 +1372,7 @@ socks_generate_msg(struct lws *wsi, enum socks_msg_type type, ssize_t *msg_len)
break;
case SOCKS_MSG_CONNECT:
n = strlen(wsi->stash->address);
n = strlen(wsi->stash->cis[CIS_ADDRESS]);
if (n > 254 || lws_ptr_diff(end, p) < 5 + n + 2)
return 1;
@ -1391,7 +1391,7 @@ socks_generate_msg(struct lws *wsi, enum socks_msg_type type, ssize_t *msg_len)
*p++ = n;
/* the address we tell SOCKS proxy to connect to */
memcpy(p, wsi->stash->address, n);
memcpy(p, wsi->stash->cis[CIS_ADDRESS], n);
p += n;
net_num = htons(wsi->c_port);

View file

@ -80,6 +80,7 @@ lws_client_socket_service(struct lws *wsi, struct lws_pollfd *pollfd,
int n = 0;
#if defined(LWS_WITH_SOCKS5)
int conn_mode = 0, pending_timeout = 0;
ssize_t len;
#endif
if ((pollfd->revents & LWS_POLLOUT) &&