From: Fabian Keil Date: Tue, 19 May 2009 17:27:05 +0000 (+0000) Subject: Fix keep-alive upgrading if connection-sharing is used. X-Git-Tag: v_3_0_13~89 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=ad160fb00a0b5916a37a2494c97f9ab4074b57ff Fix keep-alive upgrading if connection-sharing is used. --- diff --git a/parsers.c b/parsers.c index 1a0323c1..a4c9868c 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.156 2009/05/13 18:22:45 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.157 2009/05/16 13:27:20 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -1672,22 +1672,27 @@ static jb_err client_connection(struct client_state *csp, char **header) if (strcmpic(*header, wanted_header)) { #ifdef FEATURE_CONNECTION_KEEP_ALIVE - log_error(LOG_LEVEL_HEADER, - "Keeping the client header '%s' around. " - "The connection will not be kept alive.", - *header); -#else - char *old_header = *header; - - *header = strdup(wanted_header); - if (header == NULL) - { - return JB_ERR_MEMORY; + if (!(csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING)) + { + log_error(LOG_LEVEL_HEADER, + "Keeping the client header '%s' around. " + "The connection will not be kept alive.", + *header); } - log_error(LOG_LEVEL_HEADER, - "Replaced: \'%s\' with \'%s\'", old_header, *header); - freez(old_header); + else #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ + { + char *old_header = *header; + + *header = strdup(wanted_header); + if (header == NULL) + { + return JB_ERR_MEMORY; + } + log_error(LOG_LEVEL_HEADER, + "Replaced: \'%s\' with \'%s\'", old_header, *header); + freez(old_header); + } } #ifdef FEATURE_CONNECTION_KEEP_ALIVE else