------------------------------------------------------------ revno: 13057 revision-id: squid3@treenet.co.nz-20131215051846-ww8ofs7nmy1zcjz9 parent: squid3@treenet.co.nz-20131215050625-rqrlk4isk3o4lpej fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3806 author: Alex Rousskov committer: Amos Jeffries branch nick: 3.4 timestamp: Sat 2013-12-14 22:18:46 -0700 message: Bug 3806: Caching responses with Vary header ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131215051846-ww8ofs7nmy1zcjz9 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # testament_sha1: adee3d784aabfe8e5ea2b1afeb20f2c7dd908168 # timestamp: 2013-12-15 05:25:52 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # base_revision_id: squid3@treenet.co.nz-20131215050625-\ # rqrlk4isk3o4lpej # # Begin patch === modified file 'src/MemStore.cc' --- src/MemStore.cc 2012-10-16 00:18:09 +0000 +++ src/MemStore.cc 2013-12-15 05:18:46 +0000 @@ -310,6 +310,12 @@ return; } + if (e.mem_obj->vary_headers) { + // XXX: We must store/load SerialisedMetaData to cache Vary in RAM + debugs(20, 5, "Vary not yet supported: " << e.mem_obj->vary_headers); + return; + } + keep(e); // may still fail } === modified file 'src/client_side_reply.cc' --- src/client_side_reply.cc 2013-07-15 07:49:43 +0000 +++ src/client_side_reply.cc 2013-12-15 05:18:46 +0000 @@ -487,6 +487,7 @@ if (strcmp(e->mem_obj->url, http->request->storeId()) != 0) { debugs(33, DBG_IMPORTANT, "clientProcessHit: URL mismatch, '" << e->mem_obj->url << "' != '" << http->request->storeId() << "'"); + http->logType = LOG_TCP_MISS; // we lack a more precise LOG_*_MISS code processMiss(); return; } @@ -518,6 +519,7 @@ case VARY_CANCEL: /* varyEvaluateMatch found a object loop. Process as miss */ debugs(88, DBG_IMPORTANT, "clientProcessHit: Vary object loop!"); + http->logType = LOG_TCP_MISS; // we lack a more precise LOG_*_MISS code processMiss(); return; } === modified file 'src/store.cc' --- src/store.cc 2013-07-15 07:49:43 +0000 +++ src/store.cc 2013-12-15 05:18:46 +0000 @@ -795,12 +795,14 @@ } #endif - pe->replaceHttpReply(rep); + pe->replaceHttpReply(rep, false); // no write until key is public pe->timestampsSet(); pe->makePublic(); + pe->startWriting(); // after makePublic() + pe->complete(); pe->unlock();