]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2096: allow pending cache hits when delay pools not compiled in
authorwessels <>
Tue, 27 Nov 2007 05:20:04 +0000 (05:20 +0000)
committerwessels <>
Tue, 27 Nov 2007 05:20:04 +0000 (05:20 +0000)
For some time now, Squid has marked pending cache hits (a cache hit
when e->store_status != STORE_OK) as LOG_TCP_MISS.  This was done
so that pending hits do not bypass delay pools.  It had the negative
side effect of generating confusing access.log entries because cache
hits get logged as miss.

With this patch, the behavior is reverted when delay pools are not
compiled in.  Pending hits will be logged as some kind of TCP_HIT.

Users of delay pools will just have to live with this logging quirk,
although the "forwarded to" field of access.log can always be used
to see if the request was forwarded (a miss) or not (a hit).

src/client_side_reply.cc

index bca837ca14dc0141056b2577048810c6155ba316..8646dc76b6ea5a8b0b31a3b77b1ed48432d2bceb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.cc,v 1.142 2007/11/15 23:33:05 wessels Exp $
+ * $Id: client_side_reply.cc,v 1.143 2007/11/26 22:20:04 wessels Exp $
  *
  * DEBUG: section 88    Client-side Reply Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -636,9 +636,12 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
          * plain ol' cache hit
          */
 
++#if DELAY_POOLS
         if (e->store_status != STORE_OK)
             http->logType = LOG_TCP_MISS;
-        else if (e->mem_status == IN_MEMORY)
+        else
+#endif
+       if (e->mem_status == IN_MEMORY)
             http->logType = LOG_TCP_MEM_HIT;
         else if (Config.onoff.offline)
             http->logType = LOG_TCP_OFFLINE_HIT;