From: Amos Jeffries Date: Tue, 17 Nov 2015 08:14:47 +0000 (-0800) Subject: Split kick() out of finished(), making terminateAll() cleaner X-Git-Tag: SQUID_4_0_3~5^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb7fa5cf4c944e5d5dac9562c0e2eafd18ad6d67;p=thirdparty%2Fsquid.git Split kick() out of finished(), making terminateAll() cleaner --- diff --git a/src/client_side.cc b/src/client_side.cc index f0a9d759cb..ec0db651a0 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -261,7 +261,6 @@ ClientSocketContext::finished() connRegistered_ = false; assert(conn->pipeline.front() == this); // XXX: still assumes HTTP/1 semantics conn->pipeline.popMe(ClientSocketContext::Pointer(this)); - conn->kick(); // kick anything which was waiting for us to finish } ClientSocketContext::ClientSocketContext(const Comm::ConnectionPointer &aConn, ClientHttpRequest *aReq) : @@ -1754,11 +1753,14 @@ ClientSocketContext::writeComplete(const Comm::ConnectionPointer &conn, char *, pullData(); break; - case STREAM_COMPLETE: + case STREAM_COMPLETE: { debugs(33, 5, conn << " Stream complete, keepalive is " << http->request->flags.proxyKeepalive); + ConnStateData *c = http->getConn(); if (!http->request->flags.proxyKeepalive) clientConnection->close(); finished(); + c->kick(); + } return; case STREAM_UNPLANNED_COMPLETE: diff --git a/src/client_side.h b/src/client_side.h index faef326e7a..8b3f92033b 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -60,6 +60,9 @@ class PortCfg; * will perform all cleanup and deregistration operations. If the reason for * finishing is an error, then notifyIoError() needs to be called prior to * the finished() method. + * The caller should follow finished() with a call to ConnStateData::kick() + * to resume processing of other transactions or I/O on the connection. + * * Alternatively the initiateClose() method can be called to terminate the * whole client connection and all other pending contexts. * diff --git a/src/servers/FtpServer.cc b/src/servers/FtpServer.cc index 35e27bb16b..358ea70d34 100644 --- a/src/servers/FtpServer.cc +++ b/src/servers/FtpServer.cc @@ -1275,6 +1275,7 @@ Ftp::Server::wroteReply(const CommIoCbParams &io) if (bodyParser) finishDechunkingRequest(false); context->finished(); + kick(); return; } }