1 ------------------------------------------------------------
3 revision-id: squid3@treenet.co.nz-20170614215906-ly36sobvlr2pt0u6
4 parent: squid3@treenet.co.nz-20170614213720-3qmiohlx4zr2jnqq
5 fixes bug: http://bugs.squid-cache.org/show_bug.cgi?id=2833
6 author: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
7 committer: Amos Jeffries <squid3@treenet.co.nz>
9 timestamp: Thu 2017-06-15 09:59:06 +1200
11 Bug 2833 pt3: Do not respond with HTTP/304 to unconditional requests
13 ... after internal revalidation. The original unconditional HttpRequest
14 was still marked (and processed) as conditional after internal
15 revalidation because the original (clear) Last-Modified and ETag values
16 were not restored (cleared) after the internal revalidation abused them.
18 TODO: Isolate the code converting the request into conditional one _and_
19 the code that undoes that conversion, to keep both actions in sync.
20 ------------------------------------------------------------
21 # Bazaar merge directive format 2 (Bazaar 0.90)
22 # revision_id: squid3@treenet.co.nz-20170614215906-ly36sobvlr2pt0u6
23 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5
24 # testament_sha1: 0991e2d39b3bcebcf18cba3db0e3b57aabf23b8b
25 # timestamp: 2017-06-14 22:22:43 +0000
26 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5
27 # base_revision_id: squid3@treenet.co.nz-20170614213720-\
31 === modified file 'src/client_side_reply.cc'
32 --- src/client_side_reply.cc 2017-06-14 21:37:20 +0000
33 +++ src/client_side_reply.cc 2017-06-14 21:59:06 +0000
38 -clientReplyContext::clientReplyContext(ClientHttpRequest *clientContext) : http (cbdataReference(clientContext)), old_entry (NULL), old_sc(NULL), deleting(false),
39 - collapsedRevalidation(crNone)
40 +clientReplyContext::clientReplyContext(ClientHttpRequest *clientContext) : http (cbdataReference(clientContext)), old_entry (NULL),
41 + old_sc(NULL), old_lastmod(-1), deleting(false), collapsedRevalidation(crNone)
44 /** Create an error in the store awaiting the client side to read it.
46 debugs(88, 3, "clientReplyContext::saveState: saving store context");
47 old_entry = http->storeEntry();
49 + old_lastmod = http->request->lastmod;
50 + old_etag = http->request->etag;
51 old_reqsize = reqsize;
52 tempBuffer.offset = reqofs;
53 /* Prevent accessing the now saved entries */
56 reqsize = old_reqsize;
57 reqofs = tempBuffer.offset;
58 + http->request->lastmod = old_lastmod;
59 + http->request->etag = old_etag;
60 /* Prevent accessed the old saved entries */
66 tempBuffer.offset = 0;
69 === modified file 'src/client_side_reply.h'
70 --- src/client_side_reply.h 2017-01-01 00:16:45 +0000
71 +++ src/client_side_reply.h 2017-06-14 21:59:06 +0000
73 void sendNotModifiedOrPreconditionFailedError();
75 StoreEntry *old_entry;
76 - store_client *old_sc; /* ... for entry to be validated */
77 + /* ... for entry to be validated */
78 + store_client *old_sc;