From: amosjeffries <> Date: Tue, 26 Feb 2008 07:05:47 +0000 (+0000) Subject: Author: rousskov X-Git-Tag: SQUID_3_0_STABLE2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11f5d65b45dd20aef3d7c6e98ad72ea08e617718;p=thirdparty%2Fsquid.git Author: rousskov Bug 2110 fix: When Squid is shutting down, disable persistent connections in responses. This change should discourage clients from sending us more requests. It should only affect hit responses because misses are denied during shutdown. --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index b7003ccce0..fd1d115483 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.144.2.2 2008/02/24 11:43:27 amosjeffries Exp $ + * $Id: client_side_reply.cc,v 1.144.2.3 2008/02/26 00:05:47 amosjeffries Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -1314,6 +1314,9 @@ clientReplyContext::buildReplyHeader() #endif + /* Check whether we should send keep-alive */ + // TODO: disable proxy_keepalive only once + if (reply->bodySize(request->method) < 0) { debugs(88, 3, "clientBuildReplyHeader: can't keep-alive, unknown body size" ); request->flags.proxy_keepalive = 0; @@ -1332,6 +1335,11 @@ clientReplyContext::buildReplyHeader() if (!Config.onoff.client_pconns && !request->flags.must_keepalive) request->flags.proxy_keepalive = 0; + if (request->flags.proxy_keepalive && shutting_down) { + debugs(88, 3, "clientBuildReplyHeader: Shutting down, don't keep-alive."); + request->flags.proxy_keepalive = 0; + } + /* Append VIA */ if (Config.onoff.via) { LOCAL_ARRAY(char, bbuf, MAX_URL + 32);