------------------------------------------------------------ revno: 12578 revision-id: squid3@treenet.co.nz-20130611145534-cv2o55oxlr7tm2va parent: squid3@treenet.co.nz-20130611145201-uind6gaoyf6quk8u author: Christos Tsantilas committer: Amos Jeffries branch nick: 3.3 timestamp: Tue 2013-06-11 08:55:34 -0600 message: Fix request headers logging for icap_log The %http::>h does not print the original request headers but the adapted request headers. Also the %http::>ha does not print adapted headers. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130611145534-cv2o55oxlr7tm2va # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 99807b751b454e9ef14c46cf548245de46b7f455 # timestamp: 2013-06-11 14:57:52 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20130611145201-\ # uind6gaoyf6quk8u # # Begin patch === modified file 'src/adaptation/icap/ModXact.cc' --- src/adaptation/icap/ModXact.cc 2012-08-31 16:57:39 +0000 +++ src/adaptation/icap/ModXact.cc 2013-06-11 14:55:34 +0000 @@ -1254,9 +1254,11 @@ void Adaptation::Icap::ModXact::finalizeLogInfo() { HttpRequest * request_ = NULL; + HttpRequest * adapted_request_ = NULL; HttpReply * reply_ = NULL; - if (!(request_ = dynamic_cast(adapted.header))) { - request_ = (virgin.cause? virgin.cause: dynamic_cast(virgin.header)); + request_ = (virgin.cause? virgin.cause: dynamic_cast(virgin.header)); + if (!(adapted_request_ = dynamic_cast(adapted.header))) { + adapted_request_ = request_; reply_ = dynamic_cast(adapted.header); } @@ -1270,6 +1272,8 @@ al.cache.caddr = request_->client_addr; al.request = HTTPMSGLOCK(request_); + al.adapted_request = HTTPMSGLOCK(adapted_request_); + if (reply_) al.reply = HTTPMSGLOCK(reply_); else @@ -1313,7 +1317,7 @@ packerClean(&p); mb.clean(); } - prepareLogWithRequestDetails(request_, alep); + prepareLogWithRequestDetails(adapted_request_, alep); Xaction::finalizeLogInfo(); }