]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/squid/squid-3.5-14170.patch
squid 3.5.26: latest patches (14169-14182)
[ipfire-2.x.git] / src / patches / squid / squid-3.5-14170.patch
1 ------------------------------------------------------------
2 revno: 14170
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>
8 branch nick: 3.5
9 timestamp: Thu 2017-06-15 09:59:06 +1200
10 message:
11 Bug 2833 pt3: Do not respond with HTTP/304 to unconditional requests
12
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.
17
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-\
28 # 3qmiohlx4zr2jnqq
29 #
30 # Begin patch
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
34 @@ -72,8 +72,8 @@
35 HTTPMSGUNLOCK(reply);
36 }
37
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)
42 {}
43
44 /** Create an error in the store awaiting the client side to read it.
45 @@ -185,6 +185,8 @@
46 debugs(88, 3, "clientReplyContext::saveState: saving store context");
47 old_entry = http->storeEntry();
48 old_sc = sc;
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 */
54 @@ -204,9 +206,13 @@
55 sc = old_sc;
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 */
61 old_entry = NULL;
62 old_sc = NULL;
63 + old_lastmod = -1;
64 + old_etag.clean();
65 old_reqsize = 0;
66 tempBuffer.offset = 0;
67 }
68
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
72 @@ -130,7 +130,11 @@
73 void sendNotModifiedOrPreconditionFailedError();
74
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;
79 + time_t old_lastmod;
80 + String old_etag;
81 +
82 bool deleting;
83
84 typedef enum {
85