]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3929: request_header_add not working for tunnel requests
authorlibit <sambabug.lb@gmail.com>
Sun, 29 Sep 2013 17:50:16 +0000 (11:50 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 29 Sep 2013 17:50:16 +0000 (11:50 -0600)
src/client_side_request.cc
src/client_side_request.h
src/tunnel.cc

index 1c467d914572277cade65ac6b4235ff96fe17477..fce6e180839c15b59d70094a01dc0bc938ed4b01 100644 (file)
@@ -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;
     }
 
index ca12ad247cb35e1361c49d8b7395ccc0ae27eb9d..036c2d093765abec7ba3362180a8275e6c177dd9 100644 (file)
@@ -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"
index c91b68fb94c509d060c09178c472ac741166d26e..6d53f1d62f829048e6e2e56f4ef86050ba6cb62e 100644 (file)
@@ -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);