[prev in list] [next in list] [prev in thread] [next in thread]
List: squid-cvs
Subject: /bzr/squid3/trunk/ r9412: Author: Alexander Lukyanov <lav@yar.ru>
From: Amos Jeffries <squid3 () treenet ! co ! nz>
Date: 2008-12-24 13:59:42
Message-ID: 20081224141005.13795.qmail () squid-cache ! org
[Download RAW message or body]
--===============1515184650==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------
revno: 9412
committer: Amos Jeffries <squid3@treenet.co.nz>
branch nick: trunk
timestamp: Thu 2008-12-25 02:59:42 +1300
message:
Author: Alexander Lukyanov <lav@yar.ru>
Bug 2330: allow keep-alive+chunked; don't add max-age for no-cache
Attached patch enables keep-alive for chunked transfer-encoding, as such
encoding allows to determine reply body end.
Also the patch disables adding of max-age to requests with no-cache flag. It
saves a few bytes and also makes less difference between the incoming and
outgoing requests. Max-age is obviously not useful for no-cache requests.
NP: amended after bug discussion to also skip adding of no-cache on
internal calculation from local state which may not be correct
down the line in other caches. (nocache includes local config settings).
modified:
src/http.cc
--===============1515184650==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; name="r9412.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
=== modified file 'src/http.cc'
--- a/src/http.cc 2008-12-24 13:35:21 +0000
+++ b/src/http.cc 2008-12-24 13:59:42 +0000
@@ -633,7 +633,8 @@
if (_peer)
_peer->stats.n_keepalives_recv++;
- if (Config.onoff.detect_broken_server_pconns && \
reply->bodySize(request->method) == -1) { + if \
(Config.onoff.detect_broken_server_pconns + && reply->bodySize(request->method) == -1 \
&& !flags.chunked) {
debugs(11, 1, "keepaliveAccounting: Impossible keep-alive header from '" \
<< entry->url() << "'" );
// debugs(11, 2, "GOT HTTP REPLY HDR:\n---------\n" << \
readBuf->content() << "\n----------" ); flags.keepalive_broken = 1;
@@ -1604,7 +1605,14 @@
if (!cc)
cc = httpHdrCcCreate();
- if (!EBIT_TEST(cc->mask, CC_MAX_AGE)) {
+#if 0 /* see bug 2330 */
+ /* Set no-cache if determined needed but not found */
+ if (orig_request->flags.nocache)
+ EBIT_SET(cc->mask, CC_NO_CACHE);
+#endif
+
+ /* Add max-age only without no-cache */
+ if (!EBIT_TEST(cc->mask, CC_MAX_AGE) && !EBIT_TEST(cc->mask, CC_NO_CACHE)) {
const char *url =
entry ? entry->url() : urlCanonical(orig_request);
httpHdrCcSetMaxAge(cc, getMaxAge(url));
@@ -1613,10 +1621,6 @@
assert(strstr(url, request->urlpath.buf()));
}
- /* Set no-cache if determined needed but not found */
- if (orig_request->flags.nocache && !hdr_in->has(HDR_PRAGMA))
- EBIT_SET(cc->mask, CC_NO_CACHE);
-
/* Enforce sibling relations */
if (flags.only_if_cached)
EBIT_SET(cc->mask, CC_ONLY_IF_CACHED);
--===============1515184650==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic