From 61350a4abd919441f16b5951bc148ea84fecaa29 Mon Sep 17 00:00:00 2001 From: libit Date: Sun, 29 Sep 2013 11:50:16 -0600 Subject: [PATCH] Bug 3929: request_header_add not working for tunnel requests --- src/client_side_request.cc | 2 +- src/client_side_request.h | 2 +- src/tunnel.cc | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 1c467d9145..fce6e18083 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1386,7 +1386,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 ca12ad247c..036c2d0937 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -207,7 +207,7 @@ void clientAccessCheck(ClientHttpRequest *); /* ones that should be elsewhere */ void redirectStart(ClientHttpRequest *, RH *, void *); -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 c91b68fb94..6d53f1d62f 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -79,6 +79,7 @@ public: bool noConnections() const; char *url; HttpRequest *request; + AccessLogEntryPointer al; Comm::ConnectionList serverDestinations; const char * getHost() const { @@ -645,7 +646,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. */ @@ -690,6 +691,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, @@ -720,7 +722,7 @@ tunnelRelayConnectRequest(const Comm::ConnectionPointer &srv, void *data) mb.Printf("CONNECT %s HTTP/1.1\r\n", tunnelState->url); HttpStateData::httpBuildRequestHeader(tunnelState->request, NULL, /* StoreEntry */ - NULL, /* AccessLogEntry */ + tunnelState->al, /* AccessLogEntry */ &hdr_out, flags); /* flags */ packerToMemInit(&p, &mb); -- 2.47.2