mirror of
https://github.com/3proxy/3proxy.git
synced 2026-08-13 12:19:17 +08:00
Add linger timeout
This commit is contained in:
parent
eceb5a22df
commit
a986ed7a07
@ -427,9 +427,9 @@ can use %A as produced archive name and %F as filename.
|
||||
|
||||
.br
|
||||
.BR timeouts
|
||||
\fI<BYTE_SHORT>\fR \fI<BYTE_LONG>\fR \fI<STRING_SHORT>\fR \fI<STRING_LONG>\fR \fI<CONNECTION_SHORT>\fR \fI<CONNECTION_LONG>\fR \fI<DNS>\fR \fI<CHAIN>\fR \fI<CONNECT>\fR \fI<CONNECTBACK>\fR
|
||||
\fI<BYTE_SHORT>\fR \fI<BYTE_LONG>\fR \fI<STRING_SHORT>\fR \fI<STRING_LONG>\fR \fI<CONNECTION_SHORT>\fR \fI<CONNECTION_LONG>\fR \fI<DNS>\fR \fI<CHAIN>\fR \fI<CONNECT>\fR \fI<CONNECTBACK>\fR \fI<LINGER>\fR
|
||||
.br
|
||||
Sets timeout values, defaults 1, 5, 30, 60, 180, 1800, 15, 60, 15, 5.
|
||||
Sets timeout values, defaults 1, 5, 30, 60, 180, 1800, 15, 60, 15, 5, 5.
|
||||
.br
|
||||
\fBBYTE_SHORT\fR short timeout for single byte, is usually used for receiving single byte from stream.
|
||||
.br
|
||||
@ -447,7 +447,12 @@ can use %A as produced archive name and %F as filename.
|
||||
.br
|
||||
\fBCHAIN\fR timeout for reading data from chained connection
|
||||
.br
|
||||
default timeouts 1 5 30 60 180 1800 15 60 15 5
|
||||
\fBLINGER\fR timeout to deliver buffered data after one of the sides has closed
|
||||
its sending side, also used as SO_LINGER value on outgoing connections. Too small
|
||||
value may cause the tail of the data to be lost on slow connections, too large one
|
||||
delays release of the sockets.
|
||||
.br
|
||||
default timeouts 1 5 30 60 180 1800 15 60 15 5 5
|
||||
|
||||
.br
|
||||
.BR maxseg
|
||||
|
||||
@ -130,7 +130,7 @@ int timeouts[12] = {
|
||||
60, /* CHAIN_TO */
|
||||
15, /* CONNECT_TO */
|
||||
5, /* CONNBACK_TO */
|
||||
0,
|
||||
5, /* LINGER_TO */
|
||||
0
|
||||
};
|
||||
|
||||
@ -650,7 +650,7 @@ int doconnect(struct clientparam * param){
|
||||
if(param->srv->so._getpeername(param->sostate, param->remsock, (struct sockaddr *)¶m->sinsr, &size)==-1) {return (14);}
|
||||
}
|
||||
else {
|
||||
struct linger lg = {1,conf.timeouts[SINGLEBYTE_S]};
|
||||
struct linger lg = {1,conf.timeouts[LINGER_TO]};
|
||||
|
||||
if(SAISNULL(¶m->sinsr)){
|
||||
if(SAISNULL(¶m->req)) {
|
||||
|
||||
@ -780,7 +780,9 @@ log("ready reading from server pipe");
|
||||
#ifdef WITHLOG
|
||||
log("entering poll");
|
||||
#endif
|
||||
res = param->srv->so._poll(param->sostate, fds, fdsc, timeo*1000);
|
||||
res = param->srv->so._poll(param->sostate, fds, fdsc,
|
||||
((CLIENTTERMREAD || SERVERTERMREAD)?
|
||||
MIN(timeo, conf.timeouts[LINGER_TO]) : timeo) * 1000);
|
||||
#ifdef WITHLOG
|
||||
log("leaving poll");
|
||||
#endif
|
||||
|
||||
@ -882,7 +882,8 @@ typedef enum {
|
||||
DNS_TO,
|
||||
CHAIN_TO,
|
||||
CONNECT_TO,
|
||||
CONNBACK_TO
|
||||
CONNBACK_TO,
|
||||
LINGER_TO
|
||||
}TIMEOUT;
|
||||
|
||||
typedef enum {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user