Restore half-close support by default (accidentally switched off in previous fixes)

This commit is contained in:
Vladimir Dubrovin 2026-08-08 21:34:15 +03:00
parent 207ddb7f02
commit e7bc76da73
2 changed files with 12 additions and 9 deletions

View File

@ -201,11 +201,14 @@ for most traffic. Rebuild with -DWITHSPLICE to make -s available, -s0 disables i
explicitly. explicitly.
.br .br
.B -C .B -C
(for TCP services) keep the session until both sides close the connection (for TCP services) a connection closed by any of the sides terminates the
(TCP half-close). By default a connection closed by any of the sides terminates session, buffered data is delivered before the sockets are closed. By default
the session, buffered data is delivered before the sockets are closed. Half-close the session is kept until both sides close the connection (TCP half-close).
is required for the protocols where one of the sides closes its sending side and Half-close is required for the protocols where one of the sides closes its
expects the answer, it may cause the sockets to be kept in CLOSE_WAIT state. sending side and expects the answer, but it keeps the socket of the side which
has already closed the connection in CLOSE_WAIT state. Use -C to close both
sockets as soon as any of the sides closes the connection, -C1 to request
the default behaviour explicitly.
.br .br
(for dnspr) simple, do not use resolver and 3proxy cache, always use external DNS server. (for dnspr) simple, do not use resolver and 3proxy cache, always use external DNS server.
.br .br

View File

@ -329,8 +329,8 @@ int MODULEMAINFUNC (int argc, char** argv){
#endif #endif
#ifdef WITHSPLICE #ifdef WITHSPLICE
" -s Use splice() - no filtering for data, off by default\n" " -s Use splice() - no filtering for data, off by default\n"
" -C keep the session until both sides close the connection (TCP half-close),\n" " -C connection closed by any of the sides terminates the session, by default\n"
" by default connection closed by any of the sides terminates the session\n" " the session is kept until both sides close it (TCP half-close)\n"
#endif #endif
"-g(GRACE_TRAFF,GRACE_NUM,GRACE_DELAY) - delay GRACE_DELAY milliseconds before polling if average polling size below GRACE_TRAFF bytes and GRACE_NUM read operations in single directions are detected within 1 second to minimize polling\n" "-g(GRACE_TRAFF,GRACE_NUM,GRACE_DELAY) - delay GRACE_DELAY milliseconds before polling if average polling size below GRACE_TRAFF bytes and GRACE_NUM read operations in single directions are detected within 1 second to minimize polling\n"
" -fFORMAT logging format (see documentation)\n" " -fFORMAT logging format (see documentation)\n"
@ -599,7 +599,7 @@ int MODULEMAINFUNC (int argc, char** argv){
sscanf(argv[i]+2, "%d,%d,%d", &srv.gracetraf, &srv.gracenum, &srv.gracedelay); sscanf(argv[i]+2, "%d,%d,%d", &srv.gracetraf, &srv.gracenum, &srv.gracedelay);
break; break;
case 'C': case 'C':
srv.halfclose = *(argv[i]+2)? atoi(argv[i]+2) : 1; srv.halfclose = *(argv[i]+2)? atoi(argv[i]+2) : 0;
break; break;
case 's': case 's':
#ifdef WITHSPLICE #ifdef WITHSPLICE
@ -1252,7 +1252,7 @@ void srvinit(struct srvparam * srv, struct clientparam *param){
#ifdef WITHSPLICE #ifdef WITHSPLICE
srv->usesplice = 0; srv->usesplice = 0;
#endif #endif
srv->halfclose = 0; srv->halfclose = 1;
memset(param, 0, sizeof(struct clientparam)); memset(param, 0, sizeof(struct clientparam));
param->srv = srv; param->srv = srv;
param->version = srv->version; param->version = srv->version;