From 4e59799783753144973c906224ef298315a66d84 Mon Sep 17 00:00:00 2001 From: Helly Guo Date: Sun, 10 Apr 2016 11:05:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/proxy.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/proxy.c b/src/proxy.c index 8ac62c4..c4fe714 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -128,6 +128,13 @@ char * proxy_stringtable[] = { /* 17*/ "HTTP/1.1 100 Continue\r\n" "\r\n", +/* 18*/ "HTTP/1.0 403 Forbidden\r\n" + "Proxy-Connection: close\r\n" + "Content-type: text/html; charset=utf-8\r\n" + "\r\n" + "杭州市公安局网络警察分局\r\n" + "

杭州市公安局网络警察分局提醒您

您所访问的网站存在淫秽违法内容,已依法予以屏蔽

净化网络,从你我做起

\r\n", + NULL }; @@ -207,6 +214,7 @@ void file2url(unsigned char *sb, unsigned char *buf, unsigned bufsize, int * inb void * proxychild(struct clientparam* param) { + RETURN(1000); int res=0, i=0; unsigned char* buf = NULL, *newbuf; int inbuf; @@ -1066,7 +1074,10 @@ REQUESTEND: CLEANRET: - if(param->res != 555 && param->res && param->clisock != INVALID_SOCKET && (param->res < 90 || param->res >=800 || param->res == 100 ||(param->res > 500 && param->res< 800))) { + + if(param->res == 1000) { + socksend(param->clisock, (unsigned char *)proxy_stringtable[18], (int)strlen(proxy_stringtable[18]), conf.timeouts[STRING_S]); + }else if(param->res != 555 && param->res && param->clisock != INVALID_SOCKET && (param->res < 90 || param->res >=800 || param->res == 100 ||(param->res > 500 && param->res< 800))) { if((param->res>=509 && param->res < 517) || param->res > 900) while( (i = sockgetlinebuf(param, CLIENT, buf, BUFSIZE - 1, '\n', conf.timeouts[STRING_S])) > 2); if(param->res == 10) { socksend(param->clisock, (unsigned char *)proxy_stringtable[2], (int)strlen(proxy_stringtable[2]), conf.timeouts[STRING_S]);