From: Amos Jeffries Date: Mon, 11 May 2015 10:44:23 +0000 (-0700) Subject: Bug 3930: assertion 'connIsUsable(http->getConn())' X-Git-Tag: merge-candidate-3-v1~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51571330fb82d18af36ac7fdc4dcd9daeb89633e;p=thirdparty%2Fsquid.git Bug 3930: assertion 'connIsUsable(http->getConn())' --- diff --git a/src/client_side.cc b/src/client_side.cc index fb77f3cc81..b211aec493 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -194,9 +194,6 @@ static void clientUpdateStatCounters(LogTags logType); static void clientUpdateHierCounters(HierarchyLogEntry *); static bool clientPingHasFinished(ping_data const *aPing); void prepareLogWithRequestDetails(HttpRequest *, AccessLogEntry::Pointer &); -#ifndef PURIFY -static bool connIsUsable(ConnStateData * conn); -#endif static void ClientSocketContextPushDeferredIfNeeded(ClientSocketContext::Pointer deferredRequest, ConnStateData * conn); static void clientUpdateSocketStats(LogTags logType, size_t size); @@ -910,18 +907,6 @@ clientIsRequestBodyTooLargeForPolicy(int64_t bodyLength) return 0; } -#ifndef PURIFY -bool -connIsUsable(ConnStateData * conn) -{ - if (conn == NULL || !cbdataReferenceValid(conn) || !Comm::IsConnOpen(conn->clientConnection)) - return false; - - return true; -} - -#endif - // careful: the "current" context may be gone if we wrote an early response ClientSocketContext::Pointer ConnStateData::getCurrentContext() const @@ -1440,6 +1425,10 @@ void clientSocketRecipient(clientStreamNode * node, ClientHttpRequest * http, HttpReply * rep, StoreIOBuffer receivedData) { + // dont tryt to deliver if client already ABORTED + if (!http->getConn() || !cbdataReferenceValid(http->getConn()) || !Comm::IsConnOpen(http->getConn()->clientConnection)) + return; + /* Test preconditions */ assert(node != NULL); PROF_start(clientSocketRecipient); @@ -1452,7 +1441,6 @@ clientSocketRecipient(clientStreamNode * node, ClientHttpRequest * http, assert(node->node.next == NULL); ClientSocketContext::Pointer context = dynamic_cast(node->data.getRaw()); assert(context != NULL); - assert(connIsUsable(http->getConn())); /* TODO: check offset is what we asked for */