From: libit Date: Sat, 21 Sep 2013 12:23:23 +0000 (+1200) Subject: Bug 3929: request_header_add not working for tunnel requests X-Git-Tag: SQUID_3_5_0_1~638 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06521a1002a139a39100cc962b21fc85ec4263a0;p=thirdparty%2Fsquid.git Bug 3929: request_header_add not working for tunnel requests --- diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 7045cfbc7d..0f6a39b5b1 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1521,7 +1521,7 @@ ClientHttpRequest::processRequest() #endif logType = LOG_TCP_MISS; getConn()->stopReading(); // tunnels read for themselves - tunnelStart(this, &out.size, &al->http.code); + tunnelStart(this, &out.size, &al->http.code, al); return; } diff --git a/src/client_side_request.h b/src/client_side_request.h index 07bd99ee2a..509d9a1934 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -202,7 +202,7 @@ int clientHttpRequestStatus(int fd, ClientHttpRequest const *http); void clientAccessCheck(ClientHttpRequest *); /* ones that should be elsewhere */ -void tunnelStart(ClientHttpRequest *, int64_t *, int *); +void tunnelStart(ClientHttpRequest *, int64_t *, int *, const AccessLogEntry::Pointer &al); #if _USE_INLINE_ #include "Store.h" diff --git a/src/tunnel.cc b/src/tunnel.cc index d65c520e46..37cc5f700b 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -100,6 +100,7 @@ public: bool noConnections() const; char *url; HttpRequest::Pointer request; + AccessLogEntryPointer al; Comm::ConnectionList serverDestinations; const char * getHost() const { @@ -845,7 +846,7 @@ tos_t GetTosToServer(HttpRequest * request); nfmark_t GetNfmarkToServer(HttpRequest * request); void -tunnelStart(ClientHttpRequest * http, int64_t * size_ptr, int *status_ptr) +tunnelStart(ClientHttpRequest * http, int64_t * size_ptr, int *status_ptr, const AccessLogEntryPointer &al) { debugs(26, 3, HERE); /* Create state structure. */ @@ -890,6 +891,7 @@ tunnelStart(ClientHttpRequest * http, int64_t * size_ptr, int *status_ptr) tunnelState->server.size_ptr = size_ptr; tunnelState->status_ptr = status_ptr; tunnelState->client.conn = http->getConn()->clientConnection; + tunnelState->al = al; comm_add_close_handler(tunnelState->client.conn->fd, tunnelClientClosed, @@ -921,7 +923,7 @@ tunnelRelayConnectRequest(const Comm::ConnectionPointer &srv, void *data) mb.Printf("CONNECT %s HTTP/1.1\r\n", tunnelState->url); HttpStateData::httpBuildRequestHeader(tunnelState->request.getRaw(), NULL, /* StoreEntry */ - NULL, /* AccessLogEntry */ + tunnelState->al, /* AccessLogEntry */ &hdr_out, flags); /* flags */ packerToMemInit(&p, &mb);