X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=parsers.c;h=ef0fde2d78ed533665e1cb359918eb56f69d4536;hb=fbcfc6c6616fafb551c7cd13d39c42d37854c655;hp=1fc52c75b4700bece05f88efe320ced8ef7dd9ab;hpb=63a8b3ec23c0bad6b6d7f6251abaa7ea6d030e1f;p=privoxy.git diff --git a/parsers.c b/parsers.c index 1fc52c75..ef0fde2d 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.194 2009/07/11 11:16:19 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.196 2009/07/11 11:20:12 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -1691,6 +1691,14 @@ static jb_err client_keep_alive(struct client_state *csp, char **header) unsigned int keep_alive_timeout; const char *timeout_position = strstr(*header, ": "); + if (!(csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)) + { + log_error(LOG_LEVEL_HEADER, + "keep-alive support is disabled. Crunching: %s.", *header); + freez(*header); + return JB_ERR_OK; + } + if ((NULL == timeout_position) || (1 != sscanf(timeout_position, ": %u", &keep_alive_timeout))) { @@ -3487,17 +3495,8 @@ static jb_err server_connection_adder(struct client_state *csp) #ifdef FEATURE_CONNECTION_KEEP_ALIVE && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED) #endif - && (csp->http->status == 200) ) { - /* - * XXX: not doing this for status codes other than 200 works - * around problems with broken servers that will keep the - * connection open, but terminate the connection when the - * next request arrives. Once we are able to figure out which - * requests are safe to send again, this will probably no - * longer be necessary. - */ log_error(LOG_LEVEL_HEADER, "A HTTP/1.1 response " "without Connection header implies keep-alive."); csp->flags |= CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE;