diff options
author | rofl0r <rofl0r@users.noreply.github.com> | 2020-10-26 06:03:08 +0300 |
---|---|---|
committer | rofl0r <rofl0r@users.noreply.github.com> | 2020-10-26 06:03:08 +0300 |
commit | 486f8200ad9ab5c0726f021912cff09a6a21261c (patch) | |
tree | b43933883ee9161439c741fd395e5926bd894d73 | |
parent | c99d97983e66e80869416f010b6730ca98de8b01 (diff) |
tunnel_to: shrink huge buffer size
the buffer buff was only used for the initial handshake packets,
which in all supported protocols are usual less than a 100 bytes,
with user/pass and dns name at maximum we'd require 768 bytes,
which still leaves us a formidable 256 bytes for the rest of
the packet.
this fixes a segfault with microsocks which on musl uses tiny
thread stack sizes of 8KB.
-rw-r--r-- | src/core.c | 1 | ||||
-rw-r--r-- | src/core.h | 1 |
2 files changed, 1 insertions, 1 deletions
@@ -188,6 +188,7 @@ static int timed_connect(int sock, const struct sockaddr *addr, socklen_t len) { #define INVALID_INDEX 0xFFFFFFFFU +#define BUFF_SIZE 1024 // used to read responses from proxies. static int tunnel_to(int sock, ip_type ip, unsigned short port, proxy_type pt, char *user, char *pass) { char *dns_name = NULL; char hostnamebuf[MSG_LEN_MAX]; @@ -23,7 +23,6 @@ #ifndef __CORE_HEADER #define __CORE_HEADER -#define BUFF_SIZE 8*1024 // used to read responses from proxies. #define MAX_LOCALNET 64 #define MAX_DNAT 64 |