]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Log TCP_REDIRECT when Squid generates a 300-399 status response
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 12 May 2012 03:21:00 +0000 (21:21 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 12 May 2012 03:21:00 +0000 (21:21 -0600)
To identify when 3xx is received from upstream or generated by Squid.

3xx from servers or ICAP/eCAP will continue to use TCP_MISS
and other status codes.

src/client_side_reply.cc
src/enums.h
src/format/Token.cc

index 760c549a54bfd3f005431e0c766956cdfa54f385..d0df511bd975c66a41e865dcf11d2366334bab2f 100644 (file)
@@ -646,11 +646,7 @@ clientReplyContext::processMiss()
 
         if (http->redirect.status) {
             HttpReply *rep = new HttpReply;
-#if LOG_TCP_REDIRECTS
-
             http->logType = LOG_TCP_REDIRECT;
-#endif
-
             http->storeEntry()->releaseRequest();
             rep->redirect(http->redirect.status, http->redirect.location);
             http->storeEntry()->replaceHttpReply(rep);
@@ -1611,9 +1607,9 @@ clientReplyContext::identifyFoundObject(StoreEntry *newEntry)
 
     if (http->redirect.status) {
         /** \li If redirection status is True force this to be a MISS */
-        debugs(85, 3, "clientProcessRequest2: redirectStatus forced StoreEntry to NULL -  MISS");
+        debugs(85, 3, HERE << "REDIRECT status forced StoreEntry to NULL (no body on 3XX responses)");
         http->storeEntry(NULL);
-        http->logType = LOG_TCP_MISS;
+        http->logType = LOG_TCP_REDIRECT;
         doGetMoreData();
         return;
     }
index ce34b251d241975ded30cc142349c18731e892e8..fc6639641f64591b62fcba46fb73a4b7a4c6414c 100644 (file)
@@ -52,9 +52,7 @@ typedef enum {
     LOG_TCP_DENIED,
     LOG_TCP_DENIED_REPLY,
     LOG_TCP_OFFLINE_HIT,
-#if LOG_TCP_REDIRECTS
     LOG_TCP_REDIRECT,
-#endif
     LOG_UDP_HIT,
     LOG_UDP_MISS,
     LOG_UDP_DENIED,
index 6859e0a31c021440ec17c88ae8da73d22bb981ea..37c665f06b5a9437ec6ba1e439b6d88309f5bb6c 100644 (file)
@@ -20,9 +20,7 @@ const char *Format::log_tags[] = {
     "TCP_DENIED",
     "TCP_DENIED_REPLY",
     "TCP_OFFLINE_HIT",
-#if LOG_TCP_REDIRECTS
     "TCP_REDIRECT",
-#endif
     "UDP_HIT",
     "UDP_MISS",
     "UDP_DENIED",