mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Add linger timeout
This commit is contained in:
1 parent
eceb5a22df
commit
a986ed7a07
4 files changed
+15
-7
No files matched your search
+2
-2
@@ -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)) {
|
||||
|
||||
+3
-1
@@ -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
|
||||
|
||||
+2
-1
@@ -882,7 +882,8 @@ typedef enum {
|
||||
DNS_TO,
|
||||
CHAIN_TO,
|
||||
CONNECT_TO,
|
||||
CONNBACK_TO
|
||||
CONNBACK_TO,
|
||||
LINGER_TO
|
||||
}TIMEOUT;
|
||||
|
||||
typedef enum {
|
||||
|
||||
Reference in new issue
Block a user