diff --git a/binaries/freebsd-x64/tpws b/binaries/freebsd-x64/tpws index 350e9de..d86a882 100755 Binary files a/binaries/freebsd-x64/tpws and b/binaries/freebsd-x64/tpws differ diff --git a/binaries/mac64/tpws b/binaries/mac64/tpws index 6003be6..667afe4 100755 Binary files a/binaries/mac64/tpws and b/binaries/mac64/tpws differ diff --git a/tpws/tpws.c b/tpws/tpws.c index 4b3ee6f..9ba817f 100644 --- a/tpws/tpws.c +++ b/tpws/tpws.c @@ -680,16 +680,32 @@ void parse_params(int argc, char *argv[]) params.debug = optarg ? atoi(optarg) : 1; break; case 43: /* local-rcvbuf */ +#ifdef __linux__ params.local_rcvbuf = atoi(optarg)/2; +#else + params.local_rcvbuf = atoi(optarg); +#endif break; case 44: /* local-sndbuf */ +#ifdef __linux__ params.local_sndbuf = atoi(optarg)/2; +#else + params.local_sndbuf = atoi(optarg); +#endif break; case 45: /* remote-rcvbuf */ +#ifdef __linux__ params.remote_rcvbuf = atoi(optarg)/2; +#else + params.remote_rcvbuf = atoi(optarg); +#endif break; case 46: /* remote-sndbuf */ +#ifdef __linux__ params.remote_sndbuf = atoi(optarg)/2; +#else + params.remote_sndbuf = atoi(optarg); +#endif break; case 47: /* socks */ params.proxy_type = CONN_TYPE_SOCKS; diff --git a/tpws/tpws_conn.c b/tpws/tpws_conn.c index 6eba587..2bfe787 100644 --- a/tpws/tpws_conn.c +++ b/tpws/tpws_conn.c @@ -1076,7 +1076,7 @@ static bool handle_epoll(tproxy_conn_t *conn, struct tailhead *conn_list, uint32 conn->tnrd++; conn->trd+=rd; - if (split_pos && bs<=sizeof(buf) && split_pos