]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved AccessLogEntry.headers.adapt_last to AccessLogEntry.adapt.last_meta
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 11 Mar 2011 22:38:29 +0000 (15:38 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 11 Mar 2011 22:38:29 +0000 (15:38 -0700)
Added AccessLogEntry::AdaptationDetails to keep general adaptation-related
fields together and away from the HTTP fields.

src/AccessLogEntry.h
src/client_side.cc
src/log/FormatSquidCustom.cc
src/log/access_log.cc

index 18592e65527c19cc369515c05b8d05cd7ca0c109..84995c0391ffb171af4b793d45d4b60641a5070b 100644 (file)
@@ -154,23 +154,29 @@ public:
     public:
         Headers() : request(NULL),
                 adapted_request(NULL),
-
-#if USE_ADAPTATION
-                adapt_last(NULL),
-#endif
                 reply(NULL) {}
 
         char *request; //< virgin HTTP request headers
 
         char *adapted_request; //< HTTP request headers after adaptation and redirection
 
+        char *reply;
+    } headers;
 
 #if USE_ADAPTATION
+    /** \brief This subclass holds general adaptation log info.
+     * \todo Inner class declarations should be moved outside.
+     */
+    class AdaptationDetails
+    {
+
+    public:
+        AdaptationDetails(): last_meta(NULL) {}
 
-        char *adapt_last; ///< last ICAP response header or eCAP meta received
+        /// image of the last ICAP response header or eCAP meta received
+        char *last_meta;
+    } adapt;
 #endif
-        char *reply;
-    } headers;
 
     // Why is this a sub-class and not a set of real "private:" fields?
     // It looks like its duplicating HTTPRequestMethod anyway!
index 94a691ef0b374e67e181d5343061c84f6b7b6420..2feaddf4bafde2f709edb6cf3c26ae873c798982 100644 (file)
@@ -579,7 +579,7 @@ prepareLogWithRequestDetails(HttpRequest * request, AccessLogEntry * aLogEntry)
             mb.reset();
             packerToMemInit(&p, &mb);
             ah->lastMeta.packInto(&p);
-            aLogEntry->headers.adapt_last = xstrdup(mb.buf);
+            aLogEntry->adapt.last_meta = xstrdup(mb.buf);
         }
 #endif
 
index 80db596c634aaa3a7a151ec4f21b0269d6b3809f..95430844bd3fecfae5308b918538a201cc3d3650 100644 (file)
@@ -341,7 +341,7 @@ Log::Format::SquidCustom(AccessLogEntry * al, customlog * log)
             break;
 
         case LFT_ADAPTATION_LAST_ALL_HEADERS:
-            out = al->headers.adapt_last;
+            out = al->adapt.last_meta;
 
             quote = 1;
 
index 6c21efb8b8d0adc92c6ad1c234569ace989feba1..c7eb2f2a894709d0664c296d16517b26c8053e45 100644 (file)
@@ -572,7 +572,7 @@ accessLogFreeMemory(AccessLogEntry * aLogEntry)
     safe_free(aLogEntry->headers.request);
 
 #if ICAP_CLIENT
-    safe_free(aLogEntry->headers.adapt_last);
+    safe_free(aLogEntry->adapt.last_meta);
 #endif
 
     safe_free(aLogEntry->headers.reply);