]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Replace ClientSocketContext::removeFromConnectionList() with Pipeline::pop()
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 15 Nov 2015 13:33:44 +0000 (05:33 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 15 Nov 2015 13:33:44 +0000 (05:33 -0800)
src/client_side.cc
src/client_side.h
src/tests/stub_client_side.cc

index 76f3cb995cda3b41ccfcf8330e34e4dc3bbd0372..f21760bad2de028d76ce235c0e5101f038f83dcd 100644 (file)
@@ -220,27 +220,6 @@ ClientSocketContext::getConn() const
     return http->getConn();
 }
 
-void
-ClientSocketContext::removeFromConnectionList(ConnStateData * conn)
-{
-    ClientSocketContext::Pointer *tempContextPointer;
-    assert(conn != NULL && cbdataReferenceValid(conn));
-    assert(conn->currentobject != NULL);
-    /* Unlink us from the connection request list */
-    tempContextPointer = & conn->currentobject;
-
-    while (tempContextPointer->getRaw()) {
-        if (*tempContextPointer == this)
-            break;
-
-        tempContextPointer = &(*tempContextPointer)->next;
-    }
-
-    assert(tempContextPointer->getRaw() != NULL);
-    *tempContextPointer = next;
-    next = NULL;
-}
-
 ClientSocketContext::~ClientSocketContext()
 {
     clientStreamNode *node = getTail();
@@ -283,7 +262,8 @@ ClientSocketContext::connIsFinished()
 
     assert(connRegistered_);
     connRegistered_ = false;
-    removeFromConnectionList(conn);
+    assert(conn->pipeline.front() == this); // XXX: still assumes HTTP/1 semantics
+    conn->pipeline.pop();
     conn->kick(); // kick anything which was waiting for us to finish
 }
 
@@ -2369,8 +2349,10 @@ clientTunnelOnError(ConnStateData *conn, ClientSocketContext *context, HttpReque
         allow_t answer = checklist.fastCheck();
         if (answer == ACCESS_ALLOWED && answer.kind == 1) {
             debugs(33, 3, "Request will be tunneled to server");
-            if (context)
-                context->removeFromConnectionList(conn);
+            if (context) {
+                assert(conn->pipeline.front() == context); // XXX: still assumes HTTP/1 semantics
+                conn->pipeline.pop();
+            }
             Comm::SetSelect(conn->clientConnection->fd, COMM_SELECT_READ, NULL, NULL, 0);
             conn->fakeAConnectRequest("unknown-protocol", conn->preservedClientData);
             return true;
index f7f6be4b560da8cc18cf1bab620462f17ce2d274..57f64ab51d7ae3c53c33accd25a4d5153caa035c 100644 (file)
@@ -121,7 +121,6 @@ public:
     clientStreamNode * getClientReplyContext() const;
     ConnStateData *getConn() const;
     void connIsFinished();
-    void removeFromConnectionList(ConnStateData * conn);
     void deferRecipientForLater(clientStreamNode * node, HttpReply * rep, StoreIOBuffer receivedData);
     bool multipartRangeRequest() const;
     void registerWithConn();
index b60480a003520c55b4f3cef66f9bef81919fb7e4..e4f841aed74932d56d9c8ba5ded17f596b03c469 100644 (file)
@@ -29,7 +29,6 @@ void ClientSocketContext::buildRangeHeader(HttpReply * rep) STUB
 clientStreamNode * ClientSocketContext::getTail() const STUB_RETVAL(NULL)
 clientStreamNode * ClientSocketContext::getClientReplyContext() const STUB_RETVAL(NULL)
 void ClientSocketContext::connIsFinished() STUB
-void ClientSocketContext::removeFromConnectionList(ConnStateData * conn) STUB
 void ClientSocketContext::deferRecipientForLater(clientStreamNode * node, HttpReply * rep, StoreIOBuffer receivedData) STUB
 bool ClientSocketContext::multipartRangeRequest() const STUB_RETVAL(false)
 void ClientSocketContext::registerWithConn() STUB