2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
10 * DEBUG: section 33 Client Request Pipeline
13 #include "anyp/PortCfg.h"
14 #include "client_side.h"
19 Pipeline::add(const ClientSocketContextPointer
&c
)
21 requests
.push_back(c
);
23 debugs(33, 3, "Pipeline " << (void*)this << " add request " << nrequests
<< ' ' << c
);
26 ClientSocketContextPointer
27 Pipeline::front() const
29 if (requests
.empty()) {
30 debugs(33, 3, "Pipeline " << (void*)this << " empty");
31 return ClientSocketContextPointer();
34 debugs(33, 3, "Pipeline " << (void*)this << " front " << requests
.front());
35 return requests
.front();
39 Pipeline::terminateAll(int xerrno
)
41 while (!requests
.empty()) {
42 ClientSocketContextPointer context
= requests
.front();
43 debugs(33, 3, "Pipeline " << (void*)this << " notify(" << xerrno
<< ") " << context
);
44 context
->noteIoError(xerrno
);
45 context
->finished(); // cleanup and self-deregister
46 assert(context
!= requests
.front());
51 Pipeline::popMe(const ClientSocketContextPointer
&which
)
56 debugs(33, 3, "Pipeline " << (void*)this << " drop " << requests
.front());
57 // in reality there may be multiple contexts doing processing in parallel.
58 // XXX: pipeline still assumes HTTP/1 FIFO semantics are obeyed.
59 assert(which
== requests
.front());