]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Split kick() out of finished(), making terminateAll() cleaner
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 17 Nov 2015 08:14:47 +0000 (00:14 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 17 Nov 2015 08:14:47 +0000 (00:14 -0800)
src/client_side.cc
src/client_side.h
src/servers/FtpServer.cc

index f0a9d759cba2d07c75af2f922a8c8976da93e792..ec0db651a0fa324da22984b1671ac5e490d32d2a 100644 (file)
@@ -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:
index faef326e7a80113208de58c49880bca98b89bd23..8b3f92033bfe779af29a042414915e6580546776 100644 (file)
@@ -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.
  *
index 35e27bb16bd25a9314cad5180d8982e5d201a2ea..358ea70d3485a5128fc8128625e1f7ea53466efc 100644 (file)
@@ -1275,6 +1275,7 @@ Ftp::Server::wroteReply(const CommIoCbParams &io)
         if (bodyParser)
             finishDechunkingRequest(false);
         context->finished();
+        kick();
         return;
     }
 }