From 8931748f574279927c586ce0096edf77eff94147 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 16 Oct 2011 12:39:14 +0000 Subject: [PATCH] When implying keep-alive in client_connection(), remember that the client didn't Fixes a regression introduced in jcc.c,v 1.265 that would cause Privoxy to wait for additional client requests after receiving a HTTP/1.1 request with "Connection: close" set and connection sharing enabled. With clients like curl which terminates the client connection after detecting that the whole body has been received it doesn't really matter, but with clients like FreeBSD's fetch the client connection would be kept open until it timed out. Oops. As it turns out the whole "upgrade server connection to use keep-alive even when the client connection has to be closed" currently doesn't work for other reasons, so additionally add a XXX comment about it. --- parsers.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/parsers.c b/parsers.c index d5d49433..36a819f4 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.233 2011/09/04 11:36:50 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.234 2011/10/08 17:31:51 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -1850,6 +1850,15 @@ static jb_err client_connection(struct client_state *csp, char **header) log_error(LOG_LEVEL_HEADER, "Removing \'%s\' to imply keep-alive.", *header); freez(*header); + /* + * While we imply keep-alive to the server, + * we have to remember that the client didn't. + * + * XXX: The implied keep-alive currently doesn't + * actually work due to a not yet properly + * analyzed regression in chat() + */ + csp->flags &= ~CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; } else { -- 2.39.2