mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 20:20:53 +03:00
tpws: fix rcv and snd buf sizes on BSDs
This commit is contained in:
parent
61a47fd81c
commit
9aa8ec0d45
Binary file not shown.
Binary file not shown.
16
tpws/tpws.c
16
tpws/tpws.c
@ -680,16 +680,32 @@ void parse_params(int argc, char *argv[])
|
|||||||
params.debug = optarg ? atoi(optarg) : 1;
|
params.debug = optarg ? atoi(optarg) : 1;
|
||||||
break;
|
break;
|
||||||
case 43: /* local-rcvbuf */
|
case 43: /* local-rcvbuf */
|
||||||
|
#ifdef __linux__
|
||||||
params.local_rcvbuf = atoi(optarg)/2;
|
params.local_rcvbuf = atoi(optarg)/2;
|
||||||
|
#else
|
||||||
|
params.local_rcvbuf = atoi(optarg);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 44: /* local-sndbuf */
|
case 44: /* local-sndbuf */
|
||||||
|
#ifdef __linux__
|
||||||
params.local_sndbuf = atoi(optarg)/2;
|
params.local_sndbuf = atoi(optarg)/2;
|
||||||
|
#else
|
||||||
|
params.local_sndbuf = atoi(optarg);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 45: /* remote-rcvbuf */
|
case 45: /* remote-rcvbuf */
|
||||||
|
#ifdef __linux__
|
||||||
params.remote_rcvbuf = atoi(optarg)/2;
|
params.remote_rcvbuf = atoi(optarg)/2;
|
||||||
|
#else
|
||||||
|
params.remote_rcvbuf = atoi(optarg);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 46: /* remote-sndbuf */
|
case 46: /* remote-sndbuf */
|
||||||
|
#ifdef __linux__
|
||||||
params.remote_sndbuf = atoi(optarg)/2;
|
params.remote_sndbuf = atoi(optarg)/2;
|
||||||
|
#else
|
||||||
|
params.remote_sndbuf = atoi(optarg);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 47: /* socks */
|
case 47: /* socks */
|
||||||
params.proxy_type = CONN_TYPE_SOCKS;
|
params.proxy_type = CONN_TYPE_SOCKS;
|
||||||
|
@ -1076,7 +1076,7 @@ static bool handle_epoll(tproxy_conn_t *conn, struct tailhead *conn_list, uint32
|
|||||||
conn->tnrd++;
|
conn->tnrd++;
|
||||||
conn->trd+=rd;
|
conn->trd+=rd;
|
||||||
|
|
||||||
if (split_pos && bs<=sizeof(buf) && split_pos<sizeof(buf))
|
if (split_pos && bs<sizeof(buf) && split_pos<sizeof(buf))
|
||||||
{
|
{
|
||||||
VPRINT("Splitting at pos %zu%s", split_pos, (split_flags & SPLIT_FLAG_DISORDER) ? " with disorder" : "")
|
VPRINT("Splitting at pos %zu%s", split_pos, (split_flags & SPLIT_FLAG_DISORDER) ? " with disorder" : "")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user