]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Link HttpRequest with ConnStateData early
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 9 May 2011 06:40:03 +0000 (18:40 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 9 May 2011 06:40:03 +0000 (18:40 +1200)
src/client_side.cc
src/client_side_reply.cc

index cb1a3fc6238ed6928f11ea8f9505c42671449aff..622237fffac1357ca5fc2989ddc6e5157dce1813 100644 (file)
@@ -2546,6 +2546,10 @@ clientProcessRequest(ConnStateData *conn, HttpParser *hp, ClientSocketContext *c
     request->myportname = conn->port->name;
     request->http_ver = http_ver;
 
+    // Link this HttpRequest to ConnStateData relatively early so the following complex handling can use it
+    // TODO: this effectively obsoletes a lot of conn->FOO copying. That needs cleaning up later.
+    request->clientConnectionManager = conn;
+
     if (request->header.chunked()) {
         chunked = true;
     } else if (request->header.has(HDR_TRANSFER_ENCODING)) {
index 6ab8f70aa92587f8cc3157cbaa457e61c7827317..2680d1175fe7269ab84f9679b4caa19cd857c569 100644 (file)
@@ -268,8 +268,7 @@ clientReplyContext::processExpired()
     debugs(88, 5, "clientReplyContext::processExpired : lastmod " << entry->lastmod );
     http->storeEntry(entry);
     assert(http->out.offset == 0);
-
-    http->request->clientConnectionManager = http->getConn();
+    assert(http->request->clientConnectionManager == http->getConn());
 
     /*
      * A refcounted pointer so that FwdState stays around as long as
@@ -660,7 +659,7 @@ clientReplyContext::processMiss()
         if (http->flags.internal)
             r->protocol = AnyP::PROTO_INTERNAL;
 
-        r->clientConnectionManager = http->getConn();
+        assert(r->clientConnectionManager == http->getConn());
 
         /** Start forwarding to get the new object from network */
         FwdState::fwdStart(http->getConn() != NULL ? http->getConn()->fd : -1,