]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3929: request_header_add not working for tunnel requests
authorlibit <sambabug.lb@gmail.com>
Sat, 21 Sep 2013 12:23:23 +0000 (00:23 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 21 Sep 2013 12:23:23 +0000 (00:23 +1200)
src/client_side_request.cc
src/client_side_request.h
src/tunnel.cc

index 7045cfbc7d00df049f4e6ea8a463da403b787f63..0f6a39b5b125d77bf1ab9abb6d60ec475df36a5e 100644 (file)
@@ -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;
     }
 
index 07bd99ee2aabb2f7149f027ffb08753c8c67b08f..509d9a1934e03c3b66b0e710963d07d6b47c5cf7 100644 (file)
@@ -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"
index d65c520e46cda76a97a4a71ddfee0596458ef77d..37cc5f700b4cdccbe73fbd4a7e60d933f501a159 100644 (file)
@@ -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);