]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3806: Caching responses with Vary header
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 11 Dec 2013 22:44:59 +0000 (11:44 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 11 Dec 2013 22:44:59 +0000 (11:44 +1300)
src/MemStore.cc
src/client_side_reply.cc
src/store.cc

index be88e20ed120eec5b04409a91fb36de9df0d5548..b86f3e00b50f470e99ce816db7f5e63db7ed8fbb 100644 (file)
@@ -310,6 +310,12 @@ MemStore::considerKeeping(StoreEntry &e)
         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
 }
 
index 0066f60d0364fc211d38d4f7a95a59d3d26fb9a6..d8617d3b1bda3afed0fbe257a4248ec3580b8b01 100644 (file)
@@ -487,6 +487,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
 
     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 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
     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;
     }
index 4f83302388e76e9a4edd958ebc405b6a9ea0869b..e1b5038d00ce0ba3513cb4f50fc25addd8fd2760 100644 (file)
@@ -795,12 +795,14 @@ StoreEntry::setPublicKey()
             }
 
 #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();