peerConnectFailed(p);
callBack();
-
- closeQuietly();
-}
-
-void
-Http::Tunneler::closeQuietly()
-{
disconnect();
+
if (noteFwdPconnUse)
fwdPconnPool->noteUses(fd_table[connection->fd].pconn.uses);
// TODO: Reuse to-peer connections after a CONNECT error response.
AsyncJob::swanSong();
if (callback) {
- if (callback->canceled()) {
- debugs(83, 3, "cancelled by the caller");
- closeQuietly();
+ if (requestWritten && tunnelEstablished) {
+ sendSuccess();
} else {
- if (requestWritten && tunnelEstablished) {
- sendSuccess();
- } else {
- // we should have bailed when we discovered the job-killing problem
- debugs(83, DBG_IMPORTANT, "BUG: Unexpected state while establishing a CONNECT tunnel " << connection << status());
- bailWith(new ErrorState(ERR_GATEWAY_FAILURE, Http::scInternalServerError, request.getRaw(), al));
- }
- assert(!callback);
+ // job-ending emergencies like noteAbort() or callException()
+ bailWith(new ErrorState(ERR_GATEWAY_FAILURE, Http::scInternalServerError, request.getRaw(), al));
}
+ assert(!callback);
}
}
CBDATA_CLASS(Tunneler);
public:
- typedef CbcPointer<Tunneler> Pointer;
-
/// Callback dialer API to allow Tunneler to set the answer.
template <class Initiator>
class CbDialer: public CallDialer, public Http::TunnelerAnswer
TunnelerAnswer &answer();
private:
- void closeQuietly();
-
AsyncCall::Pointer writer; ///< called when the request has been written
AsyncCall::Pointer reader; ///< called when the response should be read
AsyncCall::Pointer closer; ///< called when the connection is being closed