]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Forwarder.h
2 * Copyright (C) 1996-2018 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.
9 /* DEBUG: section 16 Cache Manager API */
11 #ifndef SQUID_MGR_FORWARDER_H
12 #define SQUID_MGR_FORWARDER_H
14 #include "comm/forward.h"
15 #include "ipc/Forwarder.h"
16 #include "mgr/ActionParams.h"
18 class CommCloseCbParams
;
26 /** Forwards a single client cache manager request to Coordinator.
27 * Waits for an ACK from Coordinator while holding the Store entry.
28 * Fills the store entry with an error response if forwarding fails.
30 class Forwarder
: public Ipc::Forwarder
32 CBDATA_CLASS(Forwarder
);
35 Forwarder(const Comm::ConnectionPointer
&aConn
, const ActionParams
&aParams
, HttpRequest
* aRequest
,
40 /* Ipc::Forwarder API */
41 virtual void cleanup(); ///< perform cleanup actions
42 virtual void handleError();
43 virtual void handleTimeout();
44 virtual void handleException(const std::exception
& e
);
47 void noteCommClosed(const CommCloseCbParams
& params
);
48 void sendError(ErrorState
* error
);
51 HttpRequest
* httpRequest
; ///< HTTP client request for detailing errors
52 StoreEntry
* entry
; ///< Store entry expecting the response
53 Comm::ConnectionPointer conn
; ///< HTTP client connection descriptor
54 AsyncCall::Pointer closer
; ///< comm_close handler for the HTTP connection
59 #endif /* SQUID_MGR_FORWARDER_H */