mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 18:45:40 +08:00
Do not overwrite connection for HTTP "upgade"
This commit is contained in:
parent
1075370594
commit
cc6ec2445c
@ -439,10 +439,12 @@ for(;;){
|
|||||||
if(!sb)continue;
|
if(!sb)continue;
|
||||||
++sb;
|
++sb;
|
||||||
while(isspace(*sb))sb++;
|
while(isspace(*sb))sb++;
|
||||||
|
if(strncasecmp((char *)sb,"upgrade", 7)){
|
||||||
if(!strncasecmp((char *)sb,"keep-alive", 10))keepalive = 1;
|
if(!strncasecmp((char *)sb,"keep-alive", 10))keepalive = 1;
|
||||||
else keepalive = 0;
|
else keepalive = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if( i > 11 && !strncasecmp((char *)(buf+inbuf), "Expect: 100", 11)){
|
if( i > 11 && !strncasecmp((char *)(buf+inbuf), "Expect: 100", 11)){
|
||||||
keepalive = 1;
|
keepalive = 1;
|
||||||
socksend(param->clisock, (unsigned char *)proxy_stringtable[17], (int)strlen(proxy_stringtable[17]), conf.timeouts[STRING_S]);
|
socksend(param->clisock, (unsigned char *)proxy_stringtable[17], (int)strlen(proxy_stringtable[17]), conf.timeouts[STRING_S]);
|
||||||
@ -907,7 +909,7 @@ for(;;){
|
|||||||
++sb;
|
++sb;
|
||||||
while(isspace(*sb))sb++;
|
while(isspace(*sb))sb++;
|
||||||
if(strncasecmp((char *)sb,"keep-alive", 10))ckeepalive = 0;
|
if(strncasecmp((char *)sb,"keep-alive", 10))ckeepalive = 0;
|
||||||
if(!param->srv->transparent)continue;
|
if(!param->srv->transparent && res >= 200)continue;
|
||||||
}
|
}
|
||||||
else if(i> 6 && !param->srv->transparent && (!strncasecmp((char *)(buf+inbuf), "proxy-", 6))){
|
else if(i> 6 && !param->srv->transparent && (!strncasecmp((char *)(buf+inbuf), "proxy-", 6))){
|
||||||
continue;
|
continue;
|
||||||
@ -1006,7 +1008,7 @@ for(;;){
|
|||||||
"Proxy-support: Session-Based-Authentication\r\n"
|
"Proxy-support: Session-Based-Authentication\r\n"
|
||||||
"Connection: Proxy-support\r\n"
|
"Connection: Proxy-support\r\n"
|
||||||
);
|
);
|
||||||
if(!param->srv->transparent){
|
if(!param->srv->transparent && res>=200){
|
||||||
if(ckeepalive <= 1) sprintf((char*)buf+strlen((char *)buf), "Connection: %s\r\n",
|
if(ckeepalive <= 1) sprintf((char*)buf+strlen((char *)buf), "Connection: %s\r\n",
|
||||||
(hascontent && ckeepalive)?"keep-alive":"close");
|
(hascontent && ckeepalive)?"keep-alive":"close");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user