From 8b548dccc7b383f5b39b33da2b0edeb3fefb94d2 Mon Sep 17 00:00:00 2001 From: z3APA3A <3APA3A@3proxy.ru> Date: Sat, 17 Feb 2018 18:14:13 +0300 Subject: [PATCH] Remove "Proxy-Connection" headers as depricated --- src/proxy.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/proxy.c b/src/proxy.c index ad76100..1a72120 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -13,49 +13,49 @@ char * proxy_stringtable[] = { /* 0 */ "HTTP/1.0 400 Bad Request\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "400 Bad Request\r\n" "

400 Bad Request

\r\n", /* 1 */ "HTTP/1.0 502 Bad Gateway\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "502 Bad Gateway\r\n" "

502 Bad Gateway

Host Not Found or connection failed

\r\n", /* 2 */ "HTTP/1.0 503 Service Unavailable\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "503 Service Unavailable\r\n" "

503 Service Unavailable

You have exceeded your traffic limit

\r\n", /* 3 */ "HTTP/1.0 503 Service Unavailable\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "503 Service Unavailable\r\n" "

503 Service Unavailable

Recursion detected

\r\n", /* 4 */ "HTTP/1.0 501 Not Implemented\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "501 Not Implemented\r\n" "

501 Not Implemented

Required action is not supported by proxy server

\r\n", /* 5 */ "HTTP/1.0 502 Bad Gateway\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "502 Bad Gateway\r\n" "

502 Bad Gateway

Failed to connect parent proxy

\r\n", /* 6 */ "HTTP/1.0 500 Internal Error\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "500 Internal Error\r\n" @@ -63,7 +63,7 @@ char * proxy_stringtable[] = { /* 7 */ "HTTP/1.0 407 Proxy Authentication Required\r\n" "Proxy-Authenticate: Basic realm=\"proxy\"\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "407 Proxy Authentication Required\r\n" @@ -75,14 +75,14 @@ char * proxy_stringtable[] = { "Content-Type: text/html\r\n\r\n", /* 10*/ "HTTP/1.0 404 Not Found\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "404 Not Found\r\n" "

404 Not Found

File not found\r\n", /* 11*/ "HTTP/1.0 403 Forbidden\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "403 Access Denied\r\n" @@ -93,25 +93,25 @@ char * proxy_stringtable[] = { "Proxy-Authenticate: NTLM\r\n" #endif "Proxy-Authenticate: basic realm=\"proxy\"\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "407 Proxy Authentication Required\r\n" "

407 Proxy Authentication Required

Access to requested resource disallowed by administrator or you need valid username/password to use this resource

\r\n", /* 13*/ "HTTP/1.0 407 Proxy Authentication Required\r\n" - "Proxy-Connection: keep-alive\r\n" + "Connection: keep-alive\r\n" "Content-Length: 0\r\n" "Proxy-Authenticate: NTLM ", /* 14*/ "HTTP/1.0 403 Forbidden\r\n" - "Proxy-Connection: close\r\n" + "Connection: close\r\n" "Content-type: text/html; charset=utf-8\r\n" "\r\n" "
",
 
 /* 15*/	"HTTP/1.0 503 Service Unavailable\r\n"
-	"Proxy-Connection: close\r\n"
+	"Connection: close\r\n"
 	"Content-type: text/html; charset=utf-8\r\n"
 	"\r\n"
 	"503 Service Unavailable\r\n"
@@ -119,7 +119,7 @@ char * proxy_stringtable[] = {
 
 /* 16*/	"HTTP/1.0 401 Authentication Required\r\n"
 	"WWW-Authenticate: basic realm=\"FTP Server\"\r\n"
-	"Proxy-Connection: close\r\n"
+	"Connection: close\r\n"
 	"Content-type: text/html; charset=utf-8\r\n"
 	"\r\n"
 	"401 FTP Server requires authentication\r\n"
@@ -786,7 +786,7 @@ for(;;){
 				sprintf(ftpbuf, 
 					"HTTP/1.0 200 OK\r\n"
 					"Content-Type: text/html\r\n"
-					"Proxy-Connection: keep-alive\r\n"
+					"Connection: keep-alive\r\n"
 					"Content-Length: %d\r\n\r\n",
 					inbuf);
 				socksend(param->clisock, (unsigned char *)ftpbuf, (int)strlen(ftpbuf), conf.timeouts[STRING_S]);
@@ -847,7 +847,9 @@ for(;;){
 		sprintf((char*)buf+strlen((char *)buf), "\r\n");
  }
 #endif
- if(keepalive <= 1) sprintf((char*)buf+strlen((char *)buf), "%s: %s\r\n", (param->redirtype == R_HTTP)?"Proxy-Connection":"Connection", keepalive? "keep-alive":"close");
+ if(keepalive <= 1) {
+	sprintf((char*)buf+strlen((char *)buf), "Connection: %s\r\n", keepalive? "keep-alive":"close");
+ }
  if(param->extusername){
 	sprintf((char*)buf + strlen((char *)buf), "%s: basic ", (redirect)?"Proxy-Authorization":"Authorization");
 	sprintf((char*)username, "%.128s:%.128s", param->extusername, param->extpassword?param->extpassword:(unsigned char*)"");
@@ -992,9 +994,7 @@ for(;;){
 	 );
 	 if(!param->srv->transparent){
 		if(ckeepalive <= 1) sprintf((char*)buf+strlen((char *)buf), "Connection: %s\r\n", 
-		(hascontent && ckeepalive)?"Keep-Alive":"Close");
-		if(!param->transparent)sprintf((char*)buf+strlen((char *)buf), "Proxy-Connection: %s\r\n", 
-		(hascontent && ckeepalive)?"Keep-Alive":"Close");
+		(hascontent && ckeepalive)?"keep-alive":"close");
 	 }
 	 sprintf((char*)buf + strlen((char *)buf), "\r\n");
 	 if((socksend(param->clisock, buf, (int)strlen((char *)buf), conf.timeouts[STRING_S])) != (int)strlen((char *)buf)) {