From: Amos Jeffries Date: Mon, 21 May 2012 03:52:08 +0000 (-0600) Subject: Log TCP_REDIRECT when Squid generates a 300-399 status response X-Git-Tag: SQUID_3_2_0_18~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2a598e2be64bc5a2351b9c926a7e01bd3aacf64;p=thirdparty%2Fsquid.git Log TCP_REDIRECT when Squid generates a 300-399 status response 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. --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 2da962d681..22b797d698 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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; } diff --git a/src/enums.h b/src/enums.h index ce34b251d2..fc6639641f 100644 --- a/src/enums.h +++ b/src/enums.h @@ -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, diff --git a/src/format/Token.cc b/src/format/Token.cc index 6859e0a31c..37c665f06b 100644 --- a/src/format/Token.cc +++ b/src/format/Token.cc @@ -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",