From: Amos Jeffries Date: Sun, 15 Nov 2015 13:33:44 +0000 (-0800) Subject: Replace ClientSocketContext::removeFromConnectionList() with Pipeline::pop() X-Git-Tag: SQUID_4_0_3~5^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6400749d5689a1aeecf1d59b63c1b046dcc2b2a6;p=thirdparty%2Fsquid.git Replace ClientSocketContext::removeFromConnectionList() with Pipeline::pop() --- diff --git a/src/client_side.cc b/src/client_side.cc index 76f3cb995c..f21760bad2 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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; diff --git a/src/client_side.h b/src/client_side.h index f7f6be4b56..57f64ab51d 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -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(); diff --git a/src/tests/stub_client_side.cc b/src/tests/stub_client_side.cc index b60480a003..e4f841aed7 100644 --- a/src/tests/stub_client_side.cc +++ b/src/tests/stub_client_side.cc @@ -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