}
void
-Pipeline::pop()
+Pipeline::popMe(const ClientSocketContextPointer &which)
{
if (requests.empty())
return;
debugs(33, 3, "Pipeline " << (void*)this << " drop " << requests.front());
+ // in reality there may be multiple contexts doing processing in parallel.
+ // XXX: pipeline still assumes HTTP/1 FIFO semantics are obeyed.
+ assert(which == requests.front());
requests.pop_front();
}
typedef RefCount<ClientSocketContext> ClientSocketContextPointer;
/**
- * A queue of requests awaiting completion.
+ * A queue of transactions awaiting completion.
*
- * Requests in the queue may be fully processed, but not yet delivered,
+ * Transactions in the queue may be fully processed, but not yet delivered,
* or only partially processed.
*
* - HTTP/1 pipelined requests can be processed out of order but
* responses MUST be written to the client in-order.
+ * The front() context is for the response writing transaction.
+ * The back context may still be reading a request payload/body.
+ * Other contexts are in deferred I/O state, but may be accumulating
+ * payload/body data to be written later.
*
- * - HTTP/2 multiplexed streams (aka requests) can be processed
- * and delivered in any order.
+ * - HTTP/2 multiplexed streams can be processed and delivered in any order.
*
* For consistency we treat the pipeline as a FIFO queue in both cases.
*/
void terminateAll(const int xerrno);
/// deregister the front request from the pipeline
- void pop();
+ void popMe(const ClientSocketContextPointer &);
/// Number of requests seen in this pipeline (so far).
/// Includes incomplete transactions.
assert(connRegistered_);
connRegistered_ = false;
assert(conn->pipeline.front() == this); // XXX: still assumes HTTP/1 semantics
- conn->pipeline.pop();
+ conn->pipeline.popMe(ClientSocketContext::Pointer(this));
conn->kick(); // kick anything which was waiting for us to finish
}
debugs(33, 3, "Request will be tunneled to server");
if (context) {
assert(conn->pipeline.front() == context); // XXX: still assumes HTTP/1 semantics
- conn->pipeline.pop();
+ conn->pipeline.popMe(ClientSocketContextPointer(context));
}
Comm::SetSelect(conn->clientConnection->fd, COMM_SELECT_READ, NULL, NULL, 0);
conn->fakeAConnectRequest("unknown-protocol", conn->preservedClientData);