From: Alex Rousskov Date: Fri, 11 Mar 2011 22:38:29 +0000 (-0700) Subject: Moved AccessLogEntry.headers.adapt_last to AccessLogEntry.adapt.last_meta X-Git-Tag: take06~27^2~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99690f326a418b6b6a1cadebfce8d42c55ffcb87;p=thirdparty%2Fsquid.git Moved AccessLogEntry.headers.adapt_last to AccessLogEntry.adapt.last_meta Added AccessLogEntry::AdaptationDetails to keep general adaptation-related fields together and away from the HTTP fields. --- diff --git a/src/AccessLogEntry.h b/src/AccessLogEntry.h index 18592e6552..84995c0391 100644 --- a/src/AccessLogEntry.h +++ b/src/AccessLogEntry.h @@ -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! diff --git a/src/client_side.cc b/src/client_side.cc index 94a691ef0b..2feaddf4ba 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 diff --git a/src/log/FormatSquidCustom.cc b/src/log/FormatSquidCustom.cc index 80db596c63..95430844bd 100644 --- a/src/log/FormatSquidCustom.cc +++ b/src/log/FormatSquidCustom.cc @@ -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; diff --git a/src/log/access_log.cc b/src/log/access_log.cc index 6c21efb8b8..c7eb2f2a89 100644 --- a/src/log/access_log.cc +++ b/src/log/access_log.cc @@ -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);