]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1548: Cleanup of 304 processing
authorhno <>
Thu, 8 Jun 2006 04:39:33 +0000 (04:39 +0000)
committerhno <>
Thu, 8 Jun 2006 04:39:33 +0000 (04:39 +0000)
by Doug Dixon <doug.dixon@gmail.com>

The main change is to the logging codes. Since all refreshes hit the origin, it
does not make any sense to refer to them as HIT or MISS. Instead, they have
been renamed to describe the result from the origin server:

* TCP_REFRESH_UNMODIFIED - The requested object was cached but STALE. The IMS
query for the object resulted in "304 not modified".

* TCP_REFRESH_FAIL - The requested object was cached but STALE. The IMS query
failed and the stale object was delivered.

* TCP_REFRESH_MODIFIED - The requested object was cached but STALE. The IMS
query returned the new content.

These actually fit the FAQ now (if you change the names):
http://www.squid-cache.org/Doc/FAQ/FAQ-6.html#ss6.7

Apart from that:

1. I've corrected the set of headers that should NOT be updated in an existing
cache entry on receipt of a 304 from the origin (i.e. hop-by-hop headers)
2. I've removed a couple more functions and put the code inline. It's easier to
follow.

only allowing the entity-headers specified as being cool for 304
(section 10.3.5) to update an entry:

Content-Location
Expires

All the other entity-headers are either a SHOULD NOT or MUST NOT for including
with a 304 anyway, so always ignore these when updating an entry:

Allow
Content-Encoding
Content-Language
Content-Length
Content-MD5
Content-Range
Content-Type
Last-Modified

src/HttpHeader.cc
src/HttpHeader.h
src/HttpReply.cc
src/access_log.cc
src/client_side.cc
src/client_side_reply.cc
src/client_side_reply.h
src/enums.h

index c9e34c8b5a6891139f0018a6f48119b8dcc63821..39fba0ab2f24b1923a330e955ef51f638d91d798 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.cc,v 1.121 2006/05/29 00:15:00 robertc Exp $
+ * $Id: HttpHeader.cc,v 1.122 2006/06/07 22:39:33 hno Exp $
  *
  * DEBUG: section 55    HTTP Header
  * AUTHOR: Alex Rousskov
@@ -101,6 +101,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] =
         {"If-Modified-Since", HDR_IF_MODIFIED_SINCE, ftDate_1123},
         {"If-None-Match", HDR_IF_NONE_MATCH, ftStr},   /* for now */
         {"If-Range", HDR_IF_RANGE, ftDate_1123_or_ETag},
+        {"Keep-Alive", HDR_KEEP_ALIVE, ftStr},
         {"Last-Modified", HDR_LAST_MODIFIED, ftDate_1123},
         {"Link", HDR_LINK, ftStr},
         {"Location", HDR_LOCATION, ftStr},
@@ -118,7 +119,9 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] =
         {"Retry-After", HDR_RETRY_AFTER, ftStr},       /* for now (ftDate_1123 or ftInt!) */
         {"Server", HDR_SERVER, ftStr},
         {"Set-Cookie", HDR_SET_COOKIE, ftStr},
+        {"TE", HDR_TE, ftStr},
         {"Title", HDR_TITLE, ftStr},
+        {"Trailers", HDR_TRAILERS, ftStr},
         {"Transfer-Encoding", HDR_TRANSFER_ENCODING, ftStr},
         {"Upgrade", HDR_UPGRADE, ftStr},       /* for now */
         {"User-Agent", HDR_USER_AGENT, ftStr},
@@ -442,7 +445,6 @@ HttpHeader::update (HttpHeader const *fresh, HttpHeaderMask const *denied_mask)
     HttpHeaderPos pos = HttpHeaderInitPos;
     assert(fresh);
     assert(this != fresh);
-    debug(55, 7) ("updating hdr: %p <- %p\n", this, fresh);
 
     while ((e = fresh->getEntry(&pos))) {
         /* deny bad guys (ok to check for HDR_OTHER) here */
@@ -450,6 +452,8 @@ HttpHeader::update (HttpHeader const *fresh, HttpHeaderMask const *denied_mask)
         if (denied_mask && CBIT_TEST(*denied_mask, e->id))
             continue;
 
+        debug(55,7) ("Updating header '%s' in cached entry\n", HeadersAttrs[e->id].name);
+
         delByName(e->name.buf());
 
         addEntry(e->clone());
index 2f6abe6d5a3de3dad249c73b7a071e66d394d2b1..4d56a5ee821301ff30cf3d51d72ea3531d25481f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.h,v 1.16 2006/05/29 00:15:00 robertc Exp $
+ * $Id: HttpHeader.h,v 1.17 2006/06/07 22:39:33 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -75,6 +75,7 @@ typedef enum {
     HDR_IF_MODIFIED_SINCE,
     HDR_IF_NONE_MATCH,
     HDR_IF_RANGE,
+    HDR_KEEP_ALIVE,
     HDR_LAST_MODIFIED,
     HDR_LINK,
     HDR_LOCATION,
@@ -92,7 +93,9 @@ typedef enum {
     HDR_RETRY_AFTER,
     HDR_SERVER,
     HDR_SET_COOKIE,
+    HDR_TE,
     HDR_TITLE,
+    HDR_TRAILERS,
     HDR_TRANSFER_ENCODING,
     HDR_UPGRADE,
     HDR_USER_AGENT,
index 8a3e6b6cd5747749f5ba65fa9cb64b16af52eea0..783ab971876337cfb5bd9f86ae9c65312a4633f0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpReply.cc,v 1.88 2006/05/08 23:38:33 robertc Exp $
+ * $Id: HttpReply.cc,v 1.89 2006/06/07 22:39:33 hno Exp $
  *
  * DEBUG: section 58    HTTP Reply (Response)
  * AUTHOR: Alex Rousskov
 
 /* local constants */
 
-/* these entity-headers must be ignored if a bogus server sends them in 304 */
+/* If we receive a 304 from the origin during a cache revalidation, we must
+ * update the headers of the existing entry. Specifically, we need to update all
+ * end-to-end headers and not any hop-by-hop headers (rfc2616 13.5.3).
+ *
+ * This is not the whole story though: since it is possible for a faulty/malicious
+ * origin server to set headers it should not in a 304, we must explicitly ignore
+ * these too. Specifically all entity-headers except those permitted in a 304
+ * (rfc2616 10.3.5) must be ignored.
+ * 
+ * The list of headers we don't update is made up of:
+ *     all hop-by-hop headers
+ *     all entity-headers except Expires and Content-Location
+ */
 static HttpHeaderMask Denied304HeadersMask;
 static http_hdr_type Denied304HeadersArr[] =
     {
+        // hop-by-hop headers
+        HDR_CONNECTION, HDR_KEEP_ALIVE, HDR_PROXY_AUTHENTICATE, HDR_PROXY_AUTHORIZATION,
+        HDR_TE, HDR_TRAILERS, HDR_TRANSFER_ENCODING, HDR_UPGRADE,
+        // entity headers
         HDR_ALLOW, HDR_CONTENT_ENCODING, HDR_CONTENT_LANGUAGE, HDR_CONTENT_LENGTH,
-        HDR_CONTENT_LOCATION, HDR_CONTENT_RANGE, HDR_LAST_MODIFIED, HDR_LINK,
-        HDR_OTHER
+        HDR_CONTENT_MD5, HDR_CONTENT_RANGE, HDR_CONTENT_TYPE, HDR_LAST_MODIFIED
     };
 
 /* module initialization */
@@ -302,13 +317,13 @@ void
 HttpReply::updateOnNotModified(HttpReply const * freshRep)
 {
     assert(freshRep);
-    /* Can not update modified headers that don't match! */
-    assert (validatorsMatch(freshRep));
+
     /* clean cache */
     hdrCacheClean();
     /* update raw headers */
     header.update(&freshRep->header,
                   (const HttpHeaderMask *) &Denied304HeadersMask);
+
     /* init cache */
     hdrCacheInit();
 }
index c7e9ef06031d6e83433c98b53849c4fcd05afeec..957ed8dbaa1f1379509e618294e015bfa8756295 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: access_log.cc,v 1.114 2006/05/31 16:34:36 wessels Exp $
+ * $Id: access_log.cc,v 1.115 2006/06/07 22:39:33 hno Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -67,9 +67,9 @@ const char *log_tags[] =
         "NONE",
         "TCP_HIT",
         "TCP_MISS",
-        "TCP_REFRESH_HIT",
-        "TCP_REF_FAIL_HIT",
-        "TCP_REFRESH_MISS",
+        "TCP_REFRESH_UNMODIFIED",
+        "TCP_REFRESH_FAIL",
+        "TCP_REFRESH_MODIFIED",
         "TCP_CLIENT_REFRESH_MISS",
         "TCP_IMS_HIT",
         "TCP_SWAPFAIL_MISS",
@@ -1819,10 +1819,10 @@ logTypeIsATcpHit(log_type code)
     if (code == LOG_TCP_IMS_HIT)
         return 1;
 
-    if (code == LOG_TCP_REFRESH_FAIL_HIT)
+    if (code == LOG_TCP_REFRESH_FAIL)
         return 1;
 
-    if (code == LOG_TCP_REFRESH_HIT)
+    if (code == LOG_TCP_REFRESH_UNMODIFIED)
         return 1;
 
     if (code == LOG_TCP_NEGATIVE_HIT)
index f1eb5dcaa1f67e5e00bebf4c692352b75f174225..8aa73c5d9301a85553f04688c570923bfda90320 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.727 2006/06/06 19:22:13 hno Exp $
+ * $Id: client_side.cc,v 1.728 2006/06/07 22:39:34 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -343,13 +343,13 @@ clientUpdateStatHistCounters(log_type logType, int svc_time)
     /*
      * The idea here is not to be complete, but to get service times
      * for only well-defined types.  For example, we don't include
-     * LOG_TCP_REFRESH_FAIL_HIT because its not really a cache hit
+     * LOG_TCP_REFRESH_FAIL because its not really a cache hit
      * (we *tried* to validate it, but failed).
      */
 
     switch (logType) {
 
-    case LOG_TCP_REFRESH_HIT:
+    case LOG_TCP_REFRESH_UNMODIFIED:
         statHistCount(&statCounter.client_http.nh_svc_time, svc_time);
         break;
 
index f9dd5c8e9e318d44ed1a05dbf4ffe3cbba3dcdb8..3b2bdaab3419572603e5fb5bda64da07929c88e0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.cc,v 1.108 2006/05/19 20:22:56 wessels Exp $
+ * $Id: client_side_reply.cc,v 1.109 2006/06/07 22:39:34 hno Exp $
  *
  * DEBUG: section 88    Client-side Reply Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -288,69 +288,11 @@ clientReplyContext::processExpired()
     }
 }
 
-bool
-clientReplyContext::clientGetsOldEntry()const
-{
-    const http_status status = http->storeEntry()->getReply()->sline.status;
-
-    if (0 == status) {
-        debug(88, 5) ("clientGetsOldEntry: YES, broken HTTP reply\n");
-        return true;
-    }
-
-    /* If the reply is a failure then send the old object as a last
-     * resort */
-    if (status >= 500 && status < 600) {
-        debug(88, 3) ("clientGetsOldEntry: YES, failure reply=%d\n", status);
-        return true;
-    }
-
-    /* If the reply is anything but "Not Modified" then
-     * we must forward it to the client */
-    if (HTTP_NOT_MODIFIED != status) {
-        debug(88, 5) ("clientGetsOldEntry: NO, reply=%d\n", status);
-        return false;
-    }
-
-    /* If the client did not send IMS in the request, then it
-     * must get the old object, not this "Not Modified" reply 
-     * REGARDLESS of validation */
-    if (!http->request->flags.ims) {
-        debug(88, 5) ("clientGetsOldEntry: YES, no client IMS\n");
-        return true;
-    }
-
-    /* If key metadata in the reply are not consistent with the
-     * old entry, we must use the new reply.
-     * Note: this means that the server is sending garbage replies 
-     * in that it has sent an IMS that is incompatible with our request!?
-     */
-    /* This is a duplicate call through the HandleIMS code path.
-     * Can we guarantee we don't need it elsewhere?
-     */
-    if (!http->storeEntry()->getReply()->validatorsMatch(old_entry->getReply())) {
-        debug(88, 5) ("clientGetsOldEntry: NO, Old object has been invalidated"
-                      "by the new one\n");
-        return false;
-    }
-
-    /* If the client IMS time is prior to the entry LASTMOD time we
-     * need to send the old object */
-    if (old_entry->modifiedSince(http->request)) {
-        debug(88, 5) ("clientGetsOldEntry: YES, modified since %ld\n",
-                      (long int) http->request->ims);
-        return true;
-    }
-
-    debug(88, 5) ("clientGetsOldEntry: NO, new one is fine\n");
-    return false;
-}
 
 void
 clientReplyContext::sendClientUpstreamResponse()
 {
     StoreIOBuffer tempresult;
-    http->logType = LOG_TCP_REFRESH_MISS;
     removeStoreReference(&old_sc, &old_entry);
     /* here the data to send is the data we just recieved */
     tempBuffer.offset = 0;
@@ -386,164 +328,100 @@ clientReplyContext::sendClientOldEntry()
     sendMoreData(tempresult);
 }
 
+/* This is the workhorse of the HandleIMSReply callback.
+ *
+ * It is called when we've got data back from the origin following our
+ * IMS request to revalidate a stale entry.
+ */
 void
-clientReplyContext::cleanUpAfterIMSCheck()
-{
-    debug(88, 3) ("clientHandleIMSReply: ABORTED '%s'\n", storeUrl(http->storeEntry()));
-    /* We have an existing entry, but failed to validate it */
-    /* Its okay to send the old one anyway */
-    http->logType = LOG_TCP_REFRESH_FAIL_HIT;
-    sendClientOldEntry();
-}
-
-void
-clientReplyContext::handlePartialIMSHeaders()
+clientReplyContext::handleIMSReply(StoreIOBuffer result)
 {
-    /* more headers needed to decide */
-    debug(88, 3) ("clientHandleIMSReply: Incomplete headers for '%s'\n",
-                  storeUrl(http->storeEntry()));
-
-    if (reqsize >= HTTP_REQBUF_SZ) {
-        /* will not get any bigger than that */
-        debug(88, 3)
-        ("clientHandleIMSReply: Reply is too large '%s', using old entry\n",
-         storeUrl(http->storeEntry()));
-        /* use old entry, this repeats the code above */
-        http->logType = LOG_TCP_REFRESH_FAIL_HIT;
-        sendClientOldEntry();
-    } else {
-        reqofs = reqsize;
-        waitForMoreData();
-    }
-}
+    if (deleting)
+        return;
 
-void
-clientReplyContext::handleIMSGiveClientUpdatedOldEntry()
-{
-    /* We initiated the IMS request and the IMS is compatible with
-     * our object. As the client is not expecting
-     * 304, so put the good one back.  First, make sure the old entry
-     * headers have been loaded from disk. */
-    http->logType = LOG_TCP_REFRESH_HIT;
-
-    if (http->storeEntry()->getReply()->validatorsMatch(old_entry->getReply())) {
-        int unlink_request = 0;
-
-        if (old_entry->mem_obj->request == NULL) {
-            old_entry->mem_obj->request = HTTPMSGLOCK(http->memObject()->request);
-            unlink_request = 1;
-        }
+    debug(88, 3) ("handleIMSReply: %s, %lu bytes\n",
+                  storeUrl(http->storeEntry()),
+                  (long unsigned) result.length);
 
-        /* Don't memcpy() the whole reply structure here.  For example,
-         * www.thegist.com (Netscape/1.13) returns a content-length for
-         * 304's which seems to be the length of the 304 HEADERS!!! and
-         * not the body they refer to.  */
-        HttpReply *old_rep = (HttpReply *) old_entry->getReply();
+    if (http->storeEntry() == NULL)
+        return;
 
-        old_rep->updateOnNotModified(http->storeEntry()->getReply());
+    if (result.flags.error && !EBIT_TEST(http->storeEntry()->flags, ENTRY_ABORTED))
+        return;
 
-        storeTimestampsSet(old_entry);
+    /* update size of the request */
+    reqsize = result.length + reqofs;
 
-        old_entry->timestamp = squid_curtime;
+    const http_status status = http->storeEntry()->getReply()->sline.status;
 
-        if (unlink_request)
-            HTTPMSGUNLOCK(old_entry->mem_obj->request);
+    // request to origin was aborted
+    if (EBIT_TEST(http->storeEntry()->flags, ENTRY_ABORTED)) {
+        debug(88, 3) ("handleIMSReply: request to origin aborted '%s', sending old entry to client\n", storeUrl(http->storeEntry()));
+        http->logType = LOG_TCP_REFRESH_FAIL;
+        sendClientOldEntry();
     }
 
-    sendClientOldEntry();
-}
-
-void
-clientReplyContext::handleIMSGiveClientNewEntry()
-{
-    /* The client gets the new entry,
-     * either as a 304 (they initiated the IMS) or
-     * as a full request from the upstream
-     * The new entry is *not* a 304 reply, or
-     * is a 304 that is incompatible with our cached entities.
-     */
-
-    if (http->request->flags.ims) {
-        /* The client asked for a IMS, and can deal
-         * with any reply
-         * XXX TODO: invalidate our object if it's not valid any more.
-         * Send the IMS reply to the client.
-         */
-        sendClientUpstreamResponse();
-    } else if (http->storeEntry()->getReply()->validatorsMatch(old_entry->getReply())) {
-        /* Our object is usable once updated */
-        /* the client did not ask for IMS, send the whole object
-         */
-        /* the client needs to get this reply */
-        StoreIOBuffer tempresult;
-        http->logType = LOG_TCP_REFRESH_MISS;
+    // we have a partial reply from the origin
+    else if (STORE_PENDING == http->storeEntry()->store_status && 0 == status) {
+        // header is too large, send old entry
 
-        if (HTTP_NOT_MODIFIED == http->storeEntry()->getReply()->sline.status) {
-            HttpReply *old_rep = (HttpReply *) old_entry->getReply();
-            old_rep->updateOnNotModified(http->storeEntry()->getReply());
-            storeTimestampsSet(old_entry);
-            http->logType = LOG_TCP_REFRESH_HIT;
+        if (reqsize >= HTTP_REQBUF_SZ) {
+            debug(88, 3) ("handleIMSReply: response from origin is too large '%s', sending old entry to client\n", storeUrl(http->storeEntry()));
+            http->logType = LOG_TCP_REFRESH_FAIL;
+            sendClientOldEntry();
         }
 
-        removeStoreReference(&old_sc, &old_entry);
-        /* here the data to send is the data we just recieved */
-        tempBuffer.offset = 0;
-        old_reqsize = 0;
-        /* clientSendMoreData tracks the offset as well.
-         * Force it back to zero */
-        reqofs = 0;
-        assert(!EBIT_TEST(http->storeEntry()->flags, ENTRY_ABORTED));
-        /* TODO: provide SendMoreData with the ready parsed reply */
-        tempresult.length = reqsize;
-        tempresult.data = tempbuf;
-        sendMoreData(tempresult);
-    } else {
-        /* the client asked for the whole object, and
-         * 1) our object was stale
-         * 2) our internally generated IMS failed to validate
-         * 3) the server sent incompatible headers in it's reply
-         */
-        http->logType = LOG_TCP_REFRESH_MISS;
-        processMiss();
-        /* We start over for everything except IMS because:
-         * 1) HEAD requests will go straight through now
-         * 2) GET requests will go straight through now
-         * 3) IMS requests are a corner case. If the server
-         * decided to give us different data, we should give
-         * that to the client, which means returning our IMS request.
-         */
+        // everything looks fine, we're just waiting for more data
+        else {
+            debug(88, 3) ("handleIMSReply: incomplete headers for '%s', waiting for more data\n", storeUrl(http->storeEntry()));
+            reqofs = reqsize;
+            waitForMoreData();
+        }
     }
-}
 
-void
-clientReplyContext::handleIMSReply(StoreIOBuffer result)
-{
-    if (deleting)
-        return;
+    // we have a reply from the origin
+    else {
+        HttpReply *old_rep = (HttpReply *) old_entry->getReply();
 
-    debug(88, 3) ("clientHandleIMSReply: %s, %lu bytes\n",
-                  storeUrl(http->storeEntry()),
-                  (long unsigned) result.length);
+        // origin replied 304
 
-    if (http->storeEntry() == NULL)
-        return;
+        if (status == HTTP_NOT_MODIFIED) {
+            http->logType = LOG_TCP_REFRESH_UNMODIFIED;
 
-    if (result.flags.error && !EBIT_TEST(http->storeEntry()->flags, ENTRY_ABORTED))
-        return;
+            // update headers on existing entry
+            HttpReply *old_rep = (HttpReply *) old_entry->getReply();
+            old_rep->updateOnNotModified(http->storeEntry()->getReply());
+            storeTimestampsSet(old_entry);
 
-    /* update size of the request */
-    reqsize = result.length + reqofs;
+            // if client sent IMS
 
-    http_status status = http->storeEntry()->getReply()->sline.status;
+            if (http->request->flags.ims) {
+                // forward the 304 from origin
+                debug(88,3) ("handleIMSReply: origin replied 304, revalidating existing entry and forwarding 304 to client\n");
+                sendClientUpstreamResponse();
+            } else {
+                // send existing entry, it's still valid
+                debug(88,3) ("handleIMSReply: origin replied 304, revalidating existing entry and sending %d to client\n", old_rep->sline.status);
+                sendClientOldEntry();
+            }
+        }
 
-    if (EBIT_TEST(http->storeEntry()->flags, ENTRY_ABORTED))
-        cleanUpAfterIMSCheck();
-    else if (STORE_PENDING == http->storeEntry()->store_status && 0 == status)
-        handlePartialIMSHeaders();
-    else if (clientGetsOldEntry())
-        handleIMSGiveClientUpdatedOldEntry();
-    else
-        handleIMSGiveClientNewEntry();
+        // origin replied with a non-error code
+        else if (status > HTTP_STATUS_NONE && status < HTTP_INTERNAL_SERVER_ERROR) {
+            // forward response from origin
+            http->logType = LOG_TCP_REFRESH_MODIFIED;
+            debug(88,3) ("handleIMSReply: origin replied %d, replacing existing entry and forwarding to client\n", status);
+            sendClientUpstreamResponse();
+        }
+
+        // origin replied with an error
+        else {
+            // ignore and let client have old entry
+            http->logType = LOG_TCP_REFRESH_FAIL;
+            debug(88,3) ("handleIMSReply: origin replied with error %d, sending old entry (%d) to client\n", status, old_rep->sline.status);
+            sendClientOldEntry();
+        }
+    }
 }
 
 extern "C" CSR clientGetMoreData;
@@ -711,7 +589,6 @@ clientReplyContext::cacheHit(StoreIOBuffer result)
              * Object needs to be revalidated
              * XXX This could apply to FTP as well, if Last-Modified is known.
              */
-            http->logType = LOG_TCP_REFRESH_MISS;
             processExpired();
         } else {
             /*
index e14589fdf343c7d70cf12a7b5a5815c41370402e..daf3d206dc65f4fae8ae75429b967cc989cfdb93 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.h,v 1.13 2006/05/08 17:22:32 wessels Exp $
+ * $Id: client_side_reply.h,v 1.14 2006/06/07 22:39:34 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -78,7 +78,6 @@ public:
     void removeStoreReference(store_client ** scp, StoreEntry ** ep);
     void removeClientStoreReference(store_client **scp, ClientHttpRequest *http);
     void startError(ErrorState * err);
-    bool clientGetsOldEntry() const;
     void processExpired();
     clientStream_status_t replyStatus();
     void processMiss();
@@ -141,10 +140,6 @@ private:
     void handleIMSReply(StoreIOBuffer result);
     void sendMoreData(StoreIOBuffer result);
     void triggerInitialStoreRead();
-    void cleanUpAfterIMSCheck();
-    void handlePartialIMSHeaders();
-    void handleIMSGiveClientUpdatedOldEntry();
-    void handleIMSGiveClientNewEntry();
     void sendClientOldEntry();
     void buildMaxBodySize(HttpReply * reply);
 
index 3e0924d0b15d2be333a96ae45cca4cc28e4d0193..fdeedcdcb6f9ae38f2f9421dbb74d2cf5a4c4e19 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: enums.h,v 1.251 2006/05/29 00:15:02 robertc Exp $
+ * $Id: enums.h,v 1.252 2006/06/07 22:39:34 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -38,9 +38,9 @@ typedef enum {
     LOG_TAG_NONE,
     LOG_TCP_HIT,
     LOG_TCP_MISS,
-    LOG_TCP_REFRESH_HIT,
-    LOG_TCP_REFRESH_FAIL_HIT,
-    LOG_TCP_REFRESH_MISS,
+    LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
+    LOG_TCP_REFRESH_FAIL,       // refresh from origin failed
+    LOG_TCP_REFRESH_MODIFIED,   // refresh from origin replaced existing entry
     LOG_TCP_CLIENT_REFRESH_MISS,
     LOG_TCP_IMS_HIT,
     LOG_TCP_SWAPFAIL_MISS,