=== modified file 'src/AccessLogEntry.h'
--- src/AccessLogEntry.h	2011-08-04 03:21:06 +0000
+++ src/AccessLogEntry.h	2011-08-04 05:54:56 +0000
@@ -34,7 +34,7 @@
 #include "HttpRequestMethod.h"
 #include "HierarchyLogEntry.h"
 #include "ip/Address.h"
-#include "HttpRequestMethod.h"
+#include "SquidStatus.h"
 #if ICAP_CLIENT
 #include "adaptation/icap/Elements.h"
 #endif
@@ -133,7 +133,7 @@
         int replyHeadersSize; ///< sent, including status line
         int64_t highOffset;
         int64_t objectSize;
-        log_type code;
+        SquidStatus code;
         int msec;
         const char *rfc931;
         const char *authuser;

=== modified file 'src/AclRegs.cc'
--- src/AclRegs.cc	2011-06-20 13:42:38 +0000
+++ src/AclRegs.cc	2011-08-04 11:42:35 +0000
@@ -50,6 +50,8 @@
 #include "acl/SourceAsn.h"
 #include "acl/SourceDomain.h"
 #include "acl/SourceIp.h"
+#include "acl/SquidStatusData.h"
+#include "acl/SquidStatus.h"
 #if USE_SSL
 #include "acl/SslErrorData.h"
 #include "acl/SslError.h"
@@ -105,6 +107,8 @@
 ACLLocalIP ACLLocalIP::RegistryEntry_;
 ACL::Prototype ACLLocalPort::RegistryProtoype(&ACLLocalPort::RegistryEntry_, "localport");
 ACLStrategised<int> ACLLocalPort::RegistryEntry_(new ACLIntRange, ACLLocalPortStrategy::Instance(), "localport");
+ACL::Prototype ACLSquidStatus::RegistryProtoype(&ACLSquidStatus::RegistryEntry_, "squid_status");
+ACLStrategised<SquidStatus> ACLSquidStatus::RegistryEntry_(new ACLSquidStatusData, ACLSquidStatusStrategy::Instance(), "squid_status");
 ACL::Prototype ACLMyPortName::RegistryProtoype(&ACLMyPortName::RegistryEntry_, "myportname");
 ACLStrategised<const char *> ACLMyPortName::RegistryEntry_(new ACLStringData, ACLMyPortNameStrategy::Instance(), "myportname");
 ACL::Prototype ACLPeerName::RegistryProtoype(&ACLPeerName::RegistryEntry_, "peername");

=== modified file 'src/ClientInfo.h'
--- src/ClientInfo.h	2010-11-27 06:44:33 +0000
+++ src/ClientInfo.h	2011-07-28 08:27:33 +0000
@@ -20,7 +20,7 @@
     Ip::Address addr;
 
     struct {
-        int result_hist[LOG_TYPE_MAX];
+        int result_hist[LOG_TAG_MAX];
         int n_requests;
         kb_t kbytes_in;
         kb_t kbytes_out;

=== modified file 'src/ICP.h'
--- src/ICP.h	2011-07-16 15:21:48 +0000
+++ src/ICP.h	2011-08-04 05:50:04 +0000
@@ -118,7 +118,7 @@
     struct timeval start;
 #endif
 
-    log_type logcode;
+    SquidStatus logcode;
 
     struct timeval queue_time;
 };
@@ -140,10 +140,10 @@
 extern icp_opcode icpGetCommonOpcode();
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN int icpUdpSend(int, const Ip::Address &, icp_common_t *, log_type, int);
+SQUIDCEXTERN int icpUdpSend(int, const Ip::Address &, icp_common_t *, SquidStatus, int);
 
 /// \ingroup ServerProtocolICPAPI
-SQUIDCEXTERN log_type icpLogFromICPCode(icp_opcode opcode);
+SQUIDCEXTERN SquidStatus icpLogFromICPCode(icp_opcode opcode);
 
 /// \ingroup ServerProtocolICPAPI
 void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd);

=== modified file 'src/Makefile.am'
--- src/Makefile.am	2011-08-04 03:21:06 +0000
+++ src/Makefile.am	2011-08-04 06:44:07 +0000
@@ -532,6 +532,7 @@
 	icp_opcode.cc \
 	lookup_t.cc \
 	repl_modules.cc \
+	SquidStatus.cc \
 	swap_log_op.cc
 
 CLEANFILES += $(BUILT_SOURCES)
@@ -860,10 +861,12 @@
 icp_opcode.cc: icp_opcode.h mk-string-arrays.awk
 	$(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/icp_opcode.h > $@ || ($(RM) -f $@ && exit 1)
 
+SquidStatus.cc: SquidStatus.h mk-string-arrays.awk
+	$(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/SquidStatus.h | sed 's/LOG_//' > $@ || ($(RM) -f $@ && exit 1)
+
 swap_log_op.cc: swap_log_op.h mk-string-arrays.awk
 	$(AWK) -f $(srcdir)/mk-string-arrays.awk < $(srcdir)/swap_log_op.h > $@ || ($(RM) -f $@ && exit 1)
 
-
 ## other generated files...
 
 cache_diff: cache_diff.o debug.o globals.o store_key_md5.o

=== added file 'src/SquidStatus.h'
--- src/SquidStatus.h	1970-01-01 00:00:00 +0000
+++ src/SquidStatus.h	2011-08-04 05:34:04 +0000
@@ -0,0 +1,71 @@
+#ifndef _SQUID_SQUIDSTATUS_H
+#define _SQUID_SQUIDSTATUS_H
+
+// TODO: this should be a bitmap for better optimization
+typedef enum {
+    LOG_TAG_NONE,
+
+    LOG_TCP_HIT,
+    LOG_TCP_MISS,
+    LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
+    LOG_TCP_REFRESH_FAIL_OLD,   // refresh from origin failed, stale reply sent
+    LOG_TCP_REFRESH_FAIL_ERR,   // refresh from origin failed, error forwarded
+    LOG_TCP_REFRESH_MODIFIED,   // refresh from origin replaced existing entry
+    LOG_TCP_CLIENT_REFRESH_MISS,
+    LOG_TCP_IMS_HIT,
+    LOG_TCP_SWAPFAIL_MISS,
+    LOG_TCP_NEGATIVE_HIT,
+    LOG_TCP_MEM_HIT,
+    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,
+    LOG_UDP_INVALID,
+    LOG_UDP_MISS_NOFETCH,
+
+    LOG_ICP_QUERY,
+
+    LOG_TAG_MAX
+} SquidStatus;
+
+extern const char *SquidStatus_str[];
+
+inline bool
+logTypeIsATcpHit(SquidStatus code)
+{
+    switch(code)
+    {
+    case LOG_TCP_HIT:
+    case LOG_TCP_IMS_HIT:
+    case LOG_TCP_REFRESH_FAIL_OLD:
+    case LOG_TCP_REFRESH_UNMODIFIED:
+    case LOG_TCP_NEGATIVE_HIT:
+    case LOG_TCP_MEM_HIT:
+    case LOG_TCP_OFFLINE_HIT:
+        return true;
+
+    default:
+        return false;
+    }
+}
+
+inline SquidStatus
+operator ++(SquidStatus &i)
+{
+    return (SquidStatus)(i+1);
+}
+
+inline std::ostream &
+operator <<(std::ostream &o, const SquidStatus &i)
+{
+    o << SquidStatus_str[i];
+    return o;
+}
+
+#endif /* _SQUID_LOG_TYPE_H */

=== modified file 'src/acl/FilledChecklist.cc'
--- src/acl/FilledChecklist.cc	2011-05-13 08:13:01 +0000
+++ src/acl/FilledChecklist.cc	2011-07-28 07:40:00 +0000
@@ -57,6 +57,7 @@
         dst_rdns(NULL),
         request (NULL),
         reply (NULL),
+        logType(LOG_TAG_NONE),
 #if USE_AUTH
         auth_user_request (NULL),
 #endif

=== modified file 'src/acl/FilledChecklist.h'
--- src/acl/FilledChecklist.h	2011-02-07 10:27:53 +0000
+++ src/acl/FilledChecklist.h	2011-08-04 05:55:45 +0000
@@ -53,6 +53,7 @@
 
     HttpRequest *request;
     HttpReply *reply;
+    SquidStatus logType;
 
     char rfc931[USER_IDENT_SZ];
 #if USE_AUTH

=== modified file 'src/acl/Makefile.am'
--- src/acl/Makefile.am	2011-06-20 08:51:32 +0000
+++ src/acl/Makefile.am	2011-08-04 05:19:52 +0000
@@ -94,6 +94,10 @@
 	SourceDomain.h \
 	SourceIp.cc \
 	SourceIp.h \
+	SquidStatusData.cc \
+	SquidStatusData.h \
+	SquidStatus.cc \
+	SquidStatus.h \
 	Tag.cc \
 	Tag.h \
 	Url.cc \

=== added file 'src/acl/SquidStatus.cc'
--- src/acl/SquidStatus.cc	1970-01-01 00:00:00 +0000
+++ src/acl/SquidStatus.cc	2011-08-04 07:14:58 +0000
@@ -0,0 +1,33 @@
+#include "config.h"
+#include "acl/SquidStatus.h"
+#include "acl/SquidStatusData.h"
+#include "acl/Checklist.h"
+#include "client_side.h"
+#include "client_side_request.h"
+
+/* explicit template instantiation required for some systems */
+
+template class ACLStrategised<SquidStatus>;
+
+
+int
+ACLSquidStatusStrategy::match(ACLData<MatchType> * &data, ACLFilledChecklist *checklist)
+{
+    // XXX: where can we get the transaction type from if no connection to work through?
+    if (!checklist->conn())
+        return 0;
+    ClientSocketContext::Pointer csc = checklist->conn()->getCurrentContext();
+    ClientHttpRequest *chr = csc->http;
+    if (!chr)
+        return 0;
+
+    return data->match(chr->logType);
+}
+
+ACLSquidStatusStrategy *
+ACLSquidStatusStrategy::Instance()
+{
+    return &Instance_;
+}
+
+ACLSquidStatusStrategy ACLSquidStatusStrategy::Instance_;

=== added file 'src/acl/SquidStatus.h'
--- src/acl/SquidStatus.h	1970-01-01 00:00:00 +0000
+++ src/acl/SquidStatus.h	2011-08-04 05:38:12 +0000
@@ -0,0 +1,42 @@
+#ifndef SQUID_ACLSQUIDSTATUS_H
+#define SQUID_ACLSQUIDSTATUS_H
+
+#include "acl/Strategy.h"
+#include "acl/Strategised.h"
+#include "SquidStatus.h"
+
+/// \ingroup ACLAPI
+class ACLSquidStatusStrategy : public ACLStrategy<SquidStatus>
+{
+
+public:
+    virtual int match (ACLData<MatchType> * &, ACLFilledChecklist *);
+    virtual bool requiresRequest() const {return true;}
+
+    static ACLSquidStatusStrategy *Instance();
+
+    /**
+     * Not implemented to prevent copies of the instance.
+     \par
+     * Not private to prevent brain dead g+++ warnings about
+     * private constructors with no friends
+     */
+    ACLSquidStatusStrategy(ACLSquidStatusStrategy const &);
+
+private:
+    static ACLSquidStatusStrategy Instance_;
+    ACLSquidStatusStrategy() {}
+
+    ACLSquidStatusStrategy &operator=(ACLSquidStatusStrategy const &);
+};
+
+/// \ingroup ACLAPI
+class ACLSquidStatus
+{
+
+private:
+    static ACL::Prototype RegistryProtoype;
+    static ACLStrategised<SquidStatus> RegistryEntry_;
+};
+
+#endif /* SQUID_ACLSQUIDSTATUS_H */

=== added file 'src/acl/SquidStatusData.cc'
--- src/acl/SquidStatusData.cc	1970-01-01 00:00:00 +0000
+++ src/acl/SquidStatusData.cc	2011-08-04 05:56:11 +0000
@@ -0,0 +1,72 @@
+#include "config.h"
+#include "acl/SquidStatusData.h"
+#include "acl/Checklist.h"
+#include "SquidStatus.h"
+#include "wordlist.h"
+
+ACLSquidStatusData::ACLSquidStatusData()
+{
+    // initialize mask to NULL
+    memset(values, 0, sizeof(values));
+}
+
+ACLSquidStatusData::ACLSquidStatusData(ACLSquidStatusData const &old)
+{
+    memcpy(values, old.values, sizeof(values) );
+}
+
+ACLSquidStatusData::~ACLSquidStatusData()
+{ }
+
+bool
+ACLSquidStatusData::match(SquidStatus toFind)
+{
+    return values[toFind];
+}
+
+wordlist *
+ACLSquidStatusData::dump()
+{
+    wordlist *W = NULL;
+
+    for (SquidStatus iter=LOG_TAG_NONE; iter<LOG_TAG_MAX; ++iter) {
+        if (!values[iter]) continue;
+        wordlistAdd(&W, SquidStatus_str[iter]);
+    }
+
+    return W;
+}
+
+void
+ACLSquidStatusData::parse()
+{
+    char *t = NULL;
+
+    while ((t = strtokFile())) {
+        for (SquidStatus iter = LOG_TAG_NONE; iter <= LOG_TAG_MAX; ++iter) {
+            if (iter == LOG_TAG_MAX) {
+                fatalf("ERROR: No such squid status code '%s'",t);
+                return;
+            }
+            if (strcmp(SquidStatus_str[iter],t) == 0) {
+                values[iter] = true;
+                break; // back to while-loop
+            }
+        }
+    }
+}
+
+bool
+ACLSquidStatusData::empty() const
+{
+    for (SquidStatus iter = LOG_TAG_NONE; iter <= LOG_TAG_MAX; ++iter) {
+        if (values[iter]) return false; // not empty.
+    }
+    return true;
+}
+
+ACLData<SquidStatus> *
+ACLSquidStatusData::clone() const
+{
+    return new ACLSquidStatusData(*this);
+}

=== added file 'src/acl/SquidStatusData.h'
--- src/acl/SquidStatusData.h	1970-01-01 00:00:00 +0000
+++ src/acl/SquidStatusData.h	2011-08-04 05:37:51 +0000
@@ -0,0 +1,32 @@
+#ifndef SQUID_ACLSQUIDSTATUSDATA_H
+#define SQUID_ACLSQUIDSTATUSDATA_H
+
+#include "acl/Acl.h"
+#include "acl/Data.h"
+#include "CbDataList.h"
+#include "SquidStatus.h"
+
+/// \ingroup ACLAPI
+class ACLSquidStatusData : public ACLData<SquidStatus>
+{
+
+public:
+    MEMPROXY_CLASS(ACLSquidStatusData);
+
+    ACLSquidStatusData();
+    ACLSquidStatusData(ACLSquidStatusData const &);
+    ACLSquidStatusData &operator= (ACLSquidStatusData const &);
+    virtual ~ACLSquidStatusData();
+    bool match(SquidStatus);
+    wordlist *dump();
+    void parse();
+    bool empty() const;
+    virtual ACLData<SquidStatus> *clone() const;
+
+    // mask of codes this ACL might match.
+    bool values[LOG_TAG_MAX];
+};
+
+MEMPROXY_CLASS_INLINE(ACLSquidStatusData);
+
+#endif /* SQUID_ACLSQUIDSTATUSDATA_H */

=== modified file 'src/adaptation/icap/History.h'
--- src/adaptation/icap/History.h	2011-02-18 19:39:05 +0000
+++ src/adaptation/icap/History.h	2011-08-04 05:57:36 +0000
@@ -2,7 +2,8 @@
 #define SQUID_ICAPHISTORY_H
 
 #include "RefCount.h"
-#include "enums.h"
+#include "SquidStatus.h"
+//#include "enums.h"
 
 namespace Adaptation
 {
@@ -29,7 +30,7 @@
 #if USE_SSL
     String ssluser; ///< the username from SSL
 #endif
-    log_type logType; ///< the squid request status (TCP_MISS etc)
+    SquidStatus logType; ///< the squid request status (TCP_MISS etc)
 
     String log_uri; ///< the request uri
     size_t req_sz; ///< the request size

=== modified file 'src/client_db.cc'
--- src/client_db.cc	2011-08-04 03:21:06 +0000
+++ src/client_db.cc	2011-08-04 05:59:07 +0000
@@ -39,6 +39,7 @@
 #include "ip/Address.h"
 #include "mgr/Registration.h"
 #include "SquidMath.h"
+#include "SquidStatus.h"
 #include "SquidTime.h"
 #include "Store.h"
 
@@ -143,7 +144,7 @@
 }
 #endif
 void
-clientdbUpdate(const Ip::Address &addr, log_type ltype, AnyP::ProtocolType p, size_t size)
+clientdbUpdate(const Ip::Address &addr, SquidStatus ltype, AnyP::ProtocolType p, size_t size)
 {
     char key[MAX_IPSTRLEN];
     ClientInfo *c;
@@ -271,19 +272,12 @@
     return 1;
 }
 
-log_type &operator++ (log_type &aLogType)
-{
-    int tmp = (int)aLogType;
-    aLogType = (log_type)(++tmp);
-    return aLogType;
-}
-
 void
 clientdbDump(StoreEntry * sentry)
 {
     const char *name;
     ClientInfo *c;
-    log_type l;
+    SquidStatus l;
     int icp_total = 0;
     int icp_hits = 0;
     int http_total = 0;
@@ -301,7 +295,7 @@
         storeAppendPrintf(sentry, "    ICP  Requests %d\n",
                           c->Icp.n_requests);
 
-        for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; ++l) {
+        for (l = LOG_TAG_NONE; l < LOG_TAG_MAX; ++l) {
             if (c->Icp.result_hist[l] == 0)
                 continue;
 
@@ -310,12 +304,12 @@
             if (LOG_UDP_HIT == l)
                 icp_hits += c->Icp.result_hist[l];
 
-            storeAppendPrintf(sentry, "        %-20.20s %7d %3d%%\n",Format::log_tags[l], c->Icp.result_hist[l], Math::intPercent(c->Icp.result_hist[l], c->Icp.n_requests));
+            storeAppendPrintf(sentry, "        %-20.20s %7d %3d%%\n",SquidStatus_str[l], c->Icp.result_hist[l], Math::intPercent(c->Icp.result_hist[l], c->Icp.n_requests));
         }
 
         storeAppendPrintf(sentry, "    HTTP Requests %d\n", c->Http.n_requests);
 
-        for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; ++l) {
+        for (l = LOG_TAG_NONE; l < LOG_TAG_MAX; ++l) {
             if (c->Http.result_hist[l] == 0)
                 continue;
 
@@ -326,7 +320,7 @@
 
             storeAppendPrintf(sentry,
                               "        %-20.20s %7d %3d%%\n",
-                              Format::log_tags[l],
+                              SquidStatus_str[l],
                               c->Http.result_hist[l],
                               Math::intPercent(c->Http.result_hist[l], c->Http.n_requests));
         }
@@ -496,7 +490,7 @@
 
     variable_list *Answer = NULL;
     int aggr = 0;
-    log_type l;
+    SquidStatus l;
 
     switch (Var->name[LEN_SQ_NET + 2]) {
 
@@ -535,7 +529,7 @@
     case MESH_CTBL_HTHITS:
         aggr = 0;
 
-        for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; ++l) {
+        for (l = LOG_TAG_NONE; l < LOG_TAG_MAX; ++l) {
             if (logTypeIsATcpHit(l))
                 aggr += c->Http.result_hist[l];
         }

=== modified file 'src/client_side.cc'
--- src/client_side.cc	2011-07-28 06:04:55 +0000
+++ src/client_side.cc	2011-08-04 06:01:53 +0000
@@ -117,6 +117,7 @@
 #include "MemObject.h"
 #include "ProtoPort.h"
 #include "rfc1738.h"
+#include "SquidStatus.h"
 #include "SquidTime.h"
 #if USE_SSL
 #include "ssl/context_storage.h"
@@ -208,8 +209,8 @@
 static int clientIsContentLengthValid(HttpRequest * r);
 static int clientIsRequestBodyTooLargeForPolicy(int64_t bodyLength);
 
-static void clientUpdateStatHistCounters(log_type logType, int svc_time);
-static void clientUpdateStatCounters(log_type logType);
+static void clientUpdateStatHistCounters(SquidStatus status, int svc_time);
+static void clientUpdateStatCounters(SquidStatus status);
 static void clientUpdateHierCounters(HierarchyLogEntry *);
 static bool clientPingHasFinished(ping_data const *aPing);
 void prepareLogWithRequestDetails(HttpRequest *, AccessLogEntry *);
@@ -218,7 +219,7 @@
 #endif
 static int responseFinishedOrFailed(HttpReply * rep, StoreIOBuffer const &receivedData);
 static void ClientSocketContextPushDeferredIfNeeded(ClientSocketContext::Pointer deferredRequest, ConnStateData * conn);
-static void clientUpdateSocketStats(log_type logType, size_t size);
+static void clientUpdateSocketStats(SquidStatus status, size_t size);
 
 char *skipLeadingSpace(char *aString);
 static void connNoteUseOfBuffer(ConnStateData* conn, size_t byteCount);
@@ -423,7 +424,7 @@
 #endif
 
 void
-clientUpdateStatCounters(log_type logType)
+clientUpdateStatCounters(SquidStatus logType)
 {
     statCounter.client_http.requests++;
 
@@ -437,7 +438,7 @@
 }
 
 void
-clientUpdateStatHistCounters(log_type logType, int svc_time)
+clientUpdateStatHistCounters(SquidStatus logType, int svc_time)
 {
     statHistCount(&statCounter.client_http.all_svc_time, svc_time);
     /**
@@ -1581,7 +1582,7 @@
 }
 
 void
-clientUpdateSocketStats(log_type logType, size_t size)
+clientUpdateSocketStats(SquidStatus logType, size_t size)
 {
     if (size == 0)
         return;

=== modified file 'src/client_side_reply.cc'
--- src/client_side_reply.cc	2011-08-04 03:21:06 +0000
+++ src/client_side_reply.cc	2011-08-04 06:03:57 +0000
@@ -62,6 +62,7 @@
 #include "ipcache.h"
 #include "MemObject.h"
 #include "ProtoPort.h"
+#include "SquidStatus.h"
 #include "SquidTime.h"
 #include "StoreClient.h"
 #include "Store.h"
@@ -604,8 +605,7 @@
      */
     if (http->storeEntry()) {
         if (EBIT_TEST(http->storeEntry()->flags, ENTRY_SPECIAL)) {
-            debugs(88, 0, "clientProcessMiss: miss on a special object (" << url << ").");
-            debugs(88, 0, "\tlog_type = " << Format::log_tags[http->logType]);
+            debugs(88, DBG_CRITICAL, "clientProcessMiss: miss " << http->logType << " on a special object (" << url << ").");
             http->storeEntry()->dump(1);
         }
 

=== modified file 'src/client_side_request.cc'
--- src/client_side_request.cc	2011-08-04 03:21:06 +0000
+++ src/client_side_request.cc	2011-08-04 06:05:04 +0000
@@ -272,7 +272,7 @@
     /* the ICP check here was erroneous
      * - StoreEntry::releaseRequest was always called if entry was valid
      */
-    assert(logType < LOG_TYPE_MAX);
+    assert(logType < LOG_TAG_MAX);
 
     logRequest();
 
@@ -784,6 +784,7 @@
 #else
                                     NULL);
 #endif
+        http->getConn()->flags.readMore = true; // resume any pipeline reads.
         node = (clientStreamNode *)http->client_stream.tail->data;
         clientStreamRead(node, http, node->readBuffer);
         return;
@@ -1314,7 +1315,7 @@
 {
     PROF_start(httpStart);
     logType = LOG_TAG_NONE;
-    debugs(85, 4, "ClientHttpRequest::httpStart: " << Format::log_tags[logType] << " for '" << uri << "'");
+    debugs(85, 4, HERE << logType << " for '" << uri << "'");
 
     /* no one should have touched this */
     assert(out.offset == 0);
@@ -1773,7 +1774,7 @@
 #endif
 
     request->detailError(ERR_ICAP_FAILURE, errDetail);
-
+    c->flags.reaMore = true;
     node = (clientStreamNode *)client_stream.tail->data;
     clientStreamRead(node, this, node->readBuffer);
 }

=== modified file 'src/client_side_request.h'
--- src/client_side_request.h	2011-05-13 08:13:01 +0000
+++ src/client_side_request.h	2011-08-04 05:53:36 +0000
@@ -42,7 +42,7 @@
 #include "AccessLogEntry.h"
 #include "dlink.h"
 #include "base/AsyncJob.h"
-
+#include "SquidStatus.h"
 #if USE_ADAPTATION
 #include "adaptation/forward.h"
 #include "adaptation/Initiator.h"
@@ -113,7 +113,7 @@
 
     HttpHdrRangeIter range_iter;	/* data for iterating thru range specs */
     size_t req_sz;		/* raw request size on input, not current request size */
-    log_type logType;
+    SquidStatus logType;
 
     struct timeval start_time;
     AccessLogEntry al;

=== modified file 'src/enums.h'
--- src/enums.h	2011-07-16 04:00:55 +0000
+++ src/enums.h	2011-07-28 06:47:16 +0000
@@ -36,34 +36,6 @@
 
 #include "HttpStatusCode.h"
 
-typedef enum {
-    LOG_TAG_NONE,
-    LOG_TCP_HIT,
-    LOG_TCP_MISS,
-    LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
-    LOG_TCP_REFRESH_FAIL_OLD,   // refresh from origin failed, stale reply sent
-    LOG_TCP_REFRESH_FAIL_ERR,   // refresh from origin failed, error forwarded
-    LOG_TCP_REFRESH_MODIFIED,   // refresh from origin replaced existing entry
-    LOG_TCP_CLIENT_REFRESH_MISS,
-    LOG_TCP_IMS_HIT,
-    LOG_TCP_SWAPFAIL_MISS,
-    LOG_TCP_NEGATIVE_HIT,
-    LOG_TCP_MEM_HIT,
-    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,
-    LOG_UDP_INVALID,
-    LOG_UDP_MISS_NOFETCH,
-    LOG_ICP_QUERY,
-    LOG_TYPE_MAX
-} log_type;
-
 enum fd_type {
     FD_NONE,
     FD_LOG,

=== modified file 'src/format/Format.cc'
--- src/format/Format.cc	2011-08-04 03:21:06 +0000
+++ src/format/Format.cc	2011-08-04 07:16:59 +0000
@@ -9,6 +9,7 @@
 #include "HttpRequest.h"
 #include "MemBuf.h"
 #include "rfc1738.h"
+#include "SquidStatus.h"
 #include "SquidTime.h"
 #include "Store.h"
 
@@ -800,11 +801,11 @@
 
         case LFT_SQUID_STATUS:
             if (al->http.timedout || al->http.aborted) {
-                snprintf(tmp, sizeof(tmp), "%s%s", log_tags[al->cache.code],
+                snprintf(tmp, sizeof(tmp), "%s%s", SquidStatus_str[al->cache.code],
                          al->http.statusSfx());
                 out = tmp;
             } else {
-                out = log_tags[al->cache.code];
+                out = SquidStatus_str[al->cache.code];
             }
 
             break;

=== modified file 'src/format/Tokens.cc'
--- src/format/Tokens.cc	2011-08-04 03:21:06 +0000
+++ src/format/Tokens.cc	2011-08-04 04:58:47 +0000
@@ -2,34 +2,6 @@
 #include "format/Tokens.h"
 #include "Store.h"
 
-const char *Format::log_tags[] = {
-    "NONE",
-    "TCP_HIT",
-    "TCP_MISS",
-    "TCP_REFRESH_UNMODIFIED",
-    "TCP_REFRESH_FAIL", // same tag logged for LOG_TCP_REFRESH_FAIL_OLD and
-    "TCP_REFRESH_FAIL", // LOG_TCP_REFRESH_FAIL_ERR for backward-compatibility
-    "TCP_REFRESH_MODIFIED",
-    "TCP_CLIENT_REFRESH_MISS",
-    "TCP_IMS_HIT",
-    "TCP_SWAPFAIL_MISS",
-    "TCP_NEGATIVE_HIT",
-    "TCP_MEM_HIT",
-    "TCP_DENIED",
-    "TCP_DENIED_REPLY",
-    "TCP_OFFLINE_HIT",
-#if LOG_TCP_REDIRECTS
-    "TCP_REDIRECT",
-#endif
-    "UDP_HIT",
-    "UDP_MISS",
-    "UDP_DENIED",
-    "UDP_INVALID",
-    "UDP_MISS_NOFETCH",
-    "ICP_QUERY",
-    "LOG_TYPE_MAX"
-};
-
 struct Format::TokenTableEntry Format::TokenTable[] = {
 
     {">a", LFT_CLIENT_IP_ADDRESS},

=== modified file 'src/format/Tokens.h'
--- src/format/Tokens.h	2011-08-04 03:21:06 +0000
+++ src/format/Tokens.h	2011-08-04 05:29:01 +0000
@@ -213,7 +213,6 @@
     int options;
 };
 
-extern const char *log_tags[];
 extern struct TokenTableEntry TokenTable[];
 
 } // namespace Format

=== modified file 'src/htcp.cc'
--- src/htcp.cc	2011-07-16 15:21:48 +0000
+++ src/htcp.cc	2011-08-04 05:51:12 +0000
@@ -45,6 +45,7 @@
 #include "icmp/net_db.h"
 #include "ipc/StartListening.h"
 #include "ip/tools.h"
+#include "SquidStatus.h"
 #include "MemBuf.h"
 #include "SquidTime.h"
 #include "Store.h"
@@ -274,7 +275,7 @@
 
 static void htcpHandleMsg(char *buf, int sz, Ip::Address &from);
 
-static void htcpLogHtcp(Ip::Address &, int, log_type, const char *);
+static void htcpLogHtcp(Ip::Address &, int, SquidStatus, const char *);
 static void htcpHandleMon(htcpDataHeader *, char *buf, int sz, Ip::Address &from);
 
 static void htcpHandleNop(htcpDataHeader *, char *buf, int sz, Ip::Address &from);
@@ -1729,10 +1730,10 @@
 }
 
 static void
-htcpLogHtcp(Ip::Address &caddr, int opcode, log_type logcode, const char *url)
+htcpLogHtcp(Ip::Address &caddr, int opcode, SquidStatus logcode, const char *url)
 {
     AccessLogEntry al;
-    if (LOG_TAG_NONE == logcode)
+    if (logcode == LOG_TAG_NONE)
         return;
     if (!Config.onoff.log_udp)
         return;

=== modified file 'src/icp_v2.cc'
--- src/icp_v2.cc	2011-07-27 13:38:06 +0000
+++ src/icp_v2.cc	2011-08-04 05:52:51 +0000
@@ -53,6 +53,7 @@
 #include "ip/tools.h"
 #include "ipc/StartListening.h"
 #include "ipcache.h"
+#include "SquidStatus.h"
 #include "rfc1738.h"
 
 /// dials icpIncomingConnectionOpened call
@@ -75,7 +76,7 @@
 static void icpIncomingConnectionOpened(int errNo);
 
 /// \ingroup ServerProtocolICPInternal2
-static void icpLogIcp(const Ip::Address &, log_type, int, const char *, int);
+static void icpLogIcp(const Ip::Address &, SquidStatus, int, const char *, int);
 
 /// \ingroup ServerProtocolICPInternal2
 static void icpHandleIcpV2(int, Ip::Address &, char *, int);
@@ -200,14 +201,11 @@
 
 /// \ingroup ServerProtocolICPInternal2
 static void
-icpLogIcp(const Ip::Address &caddr, log_type logcode, int len, const char *url, int delay)
+icpLogIcp(const Ip::Address &caddr, SquidStatus logcode, int len, const char *url, int delay)
 {
     AccessLogEntry al;
 
-    if (LOG_TAG_NONE == logcode)
-        return;
-
-    if (LOG_ICP_QUERY == logcode)
+    if (logcode == LOG_TAG_NONE || logcode == LOG_ICP_QUERY)
         return;
 
     clientdbUpdate(caddr, logcode, AnyP::PROTO_ICP, len);
@@ -297,7 +295,7 @@
 icpUdpSend(int fd,
            const Ip::Address &to,
            icp_common_t * msg,
-           log_type logcode,
+           SquidStatus logcode,
            int delay)
 {
     icpUdpData *queue;
@@ -381,7 +379,7 @@
     return ICP_ERR;
 }
 
-log_type
+SquidStatus
 icpLogFromICPCode(icp_opcode opcode)
 {
     if (opcode == ICP_ERR)

=== modified file 'src/log/FormatHttpdCombined.cc'
--- src/log/FormatHttpdCombined.cc	2011-08-04 03:21:06 +0000
+++ src/log/FormatHttpdCombined.cc	2011-08-04 05:42:21 +0000
@@ -71,7 +71,7 @@
                   al->cache.replySize,
                   referer,
                   agent,
-                  ::Format::log_tags[al->cache.code],
+                  SquidStatus_str[al->cache.code],
                   al->http.statusSfx(),
                   hier_code_str[al->hier.code],
                   (Config.onoff.log_mime_hdrs?"":"\n"));

=== modified file 'src/log/FormatHttpdCommon.cc'
--- src/log/FormatHttpdCommon.cc	2011-08-04 03:21:06 +0000
+++ src/log/FormatHttpdCommon.cc	2011-08-04 05:42:38 +0000
@@ -58,7 +58,7 @@
                   al->http.version.major, al->http.version.minor,
                   al->http.code,
                   al->cache.replySize,
-                  ::Format::log_tags[al->cache.code],
+                  SquidStatus_str[al->cache.code],
                   al->http.statusSfx(),
                   hier_code_str[al->hier.code],
                   (Config.onoff.log_mime_hdrs?"":"\n"));

=== modified file 'src/log/FormatSquidNative.cc'
--- src/log/FormatSquidNative.cc	2011-08-04 03:21:06 +0000
+++ src/log/FormatSquidNative.cc	2011-08-04 05:42:49 +0000
@@ -67,7 +67,7 @@
                   (int) current_time.tv_usec / 1000,
                   al->cache.msec,
                   al->cache.caddr.NtoA(clientip, MAX_IPSTRLEN),
-                  ::Format::log_tags[al->cache.code],
+                  SquidStatus_str[al->cache.code],
                   al->http.statusSfx(),
                   al->http.code,
                   al->cache.replySize,

=== modified file 'src/log/access_log.cc'
--- src/log/access_log.cc	2011-08-04 03:21:06 +0000
+++ src/log/access_log.cc	2011-08-04 04:48:28 +0000
@@ -588,32 +588,3 @@
     HTTPMSGUNLOCK(aLogEntry->icap.request);
 #endif
 }
-
-int
-logTypeIsATcpHit(log_type code)
-{
-    /* this should be a bitmap for better optimization */
-
-    if (code == LOG_TCP_HIT)
-        return 1;
-
-    if (code == LOG_TCP_IMS_HIT)
-        return 1;
-
-    if (code == LOG_TCP_REFRESH_FAIL_OLD)
-        return 1;
-
-    if (code == LOG_TCP_REFRESH_UNMODIFIED)
-        return 1;
-
-    if (code == LOG_TCP_NEGATIVE_HIT)
-        return 1;
-
-    if (code == LOG_TCP_MEM_HIT)
-        return 1;
-
-    if (code == LOG_TCP_OFFLINE_HIT)
-        return 1;
-
-    return 0;
-}

=== modified file 'src/protos.h'
--- src/protos.h	2011-07-23 08:37:52 +0000
+++ src/protos.h	2011-08-04 05:47:00 +0000
@@ -57,7 +57,6 @@
 #if HEADERS_LOG
 SQUIDCEXTERN void headersLog(int cs, int pq, const HttpRequestMethod& m, void *data);
 #endif
-SQUIDCEXTERN int logTypeIsATcpHit(log_type);
 
 /*
  * cache_cf.c
@@ -85,7 +84,8 @@
 SQUIDCEXTERN void clientdbInit(void);
 
 #include "anyp/ProtocolType.h"
-SQUIDCEXTERN void clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t);
+#include "SquidStatus.h"
+SQUIDCEXTERN void clientdbUpdate(const Ip::Address &, SquidStatus, AnyP::ProtocolType, size_t);
 
 SQUIDCEXTERN int clientdbCutoffDenied(const Ip::Address &);
 void clientdbDump(StoreEntry *);

=== modified file 'src/ssl/ErrorDetailManager.cc'
--- src/ssl/ErrorDetailManager.cc	2011-06-18 00:12:51 +0000
+++ src/ssl/ErrorDetailManager.cc	2011-07-31 02:46:24 +0000
@@ -181,8 +181,10 @@
 bool
 Ssl::ErrorDetailFile::parse(const char *buffer, int len, bool eof)
 {
-    if (!theDetails)
+    if (!theDetails) {
+        debugs(83, 7, HERE << "no theDetails");
         return false;
+    }
 
     if (len) {
         buf.append(buffer, len);

=== modified file 'src/stat.cc'
--- src/stat.cc	2011-08-04 03:21:06 +0000
+++ src/stat.cc	2011-08-04 05:46:27 +0000
@@ -2038,7 +2038,7 @@
         }
 
         storeAppendPrintf(s, "uri %s\n", http->uri);
-        storeAppendPrintf(s, "logType %s\n", Format::log_tags[http->logType]);
+        storeAppendPrintf(s, "handling state: %s\n", SquidStatus_str[http->logType]);
         storeAppendPrintf(s, "out.offset %ld, out.size %lu\n",
                           (long int) http->out.offset, (unsigned long int) http->out.size);
         storeAppendPrintf(s, "req_sz %ld\n", (long int) http->req_sz);

=== modified file 'src/tests/stub_client_db.cc'
--- src/tests/stub_client_db.cc	2011-05-13 08:13:01 +0000
+++ src/tests/stub_client_db.cc	2011-08-04 05:40:27 +0000
@@ -1,4 +1,5 @@
 #include "config.h"
+#include "SquidStatus.h"
 /* because the clientdb API is defined in protos.h still */
 #include "protos.h"
 
@@ -9,7 +10,7 @@
 }
 
 void
-clientdbUpdate(const Ip::Address &, log_type, AnyP::ProtocolType, size_t)
+clientdbUpdate(const Ip::Address &, SquidStatus, AnyP::ProtocolType, size_t)
 {
     fatal("client_db.cc required");
 }

=== modified file 'src/tests/stub_icp.cc'
--- src/tests/stub_icp.cc	2011-07-16 15:21:48 +0000
+++ src/tests/stub_icp.cc	2011-08-04 05:40:57 +0000
@@ -2,6 +2,7 @@
 #include "comm/Connection.h"
 #include "ICP.h"
 #include "icp_opcode.h"
+#include "SquidStatus.h"
 
 #define STUB { fatal("icp_*.cc required."); }
 #define STUB_RETVAL(x) { fatal("icp_*.cc required."); return (x); }
@@ -25,8 +26,8 @@
 bool icpAccessAllowed(Ip::Address &from, HttpRequest * icp_request) STUB_RETVAL(false)
 void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from) STUB
 icp_opcode icpGetCommonOpcode() STUB_RETVAL(ICP_INVALID)
-int icpUdpSend(int, const Ip::Address &, icp_common_t *, log_type, int) STUB_RETVAL(0)
-log_type icpLogFromICPCode(icp_opcode opcode) STUB_RETVAL(LOG_TAG_NONE)
+int icpUdpSend(int, const Ip::Address &, icp_common_t *, SquidStatus, int) STUB_RETVAL(0)
+SquidStatus icpLogFromICPCode(icp_opcode opcode) STUB_RETVAL(LOG_TAG_NONE)
 void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd) STUB
 void icpHandleIcpV3(int, Ip::Address &, char *, int) STUB
 int icpCheckUdpHit(StoreEntry *, HttpRequest * request) STUB_RETVAL(0)


