]> git.ipfire.org Git - thirdparty/squid.git/blame - src/mgr/Forwarder.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / mgr / Forwarder.h
CommitLineData
8822ebee 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
8822ebee 3 *
bbc27441
AJ
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.
8822ebee
AR
7 */
8
bbc27441
AJ
9/* DEBUG: section 16 Cache Manager API */
10
8822ebee
AR
11#ifndef SQUID_MGR_FORWARDER_H
12#define SQUID_MGR_FORWARDER_H
13
c3e8e4e9 14#include "comm/forward.h"
51ea0904 15#include "ipc/Forwarder.h"
7e6eabbc 16#include "log/forward.h"
8822ebee 17#include "mgr/ActionParams.h"
8822ebee 18
8822ebee
AR
19class CommCloseCbParams;
20class HttpRequest;
21class StoreEntry;
22class ErrorState;
23
24namespace Mgr
25{
26
27/** Forwards a single client cache manager request to Coordinator.
28 * Waits for an ACK from Coordinator while holding the Store entry.
29 * Fills the store entry with an error response if forwarding fails.
30 */
51ea0904 31class Forwarder: public Ipc::Forwarder
8822ebee 32{
5c2f68b7
AJ
33 CBDATA_CLASS(Forwarder);
34
8822ebee 35public:
1b76e6c1 36 Forwarder(const Comm::ConnectionPointer &aConn, const ActionParams &aParams, HttpRequest* aRequest,
7e6eabbc 37 StoreEntry* anEntry, const AccessLogEntryPointer &anAle);
8822ebee
AR
38 virtual ~Forwarder();
39
8822ebee 40protected:
51ea0904 41 /* Ipc::Forwarder API */
ebaabe74 42 virtual void swanSong();
51ea0904
CT
43 virtual void handleError();
44 virtual void handleTimeout();
45 virtual void handleException(const std::exception& e);
8822ebee
AR
46
47private:
8822ebee 48 void noteCommClosed(const CommCloseCbParams& params);
51ea0904 49 void sendError(ErrorState* error);
8822ebee
AR
50
51private:
51ea0904 52 HttpRequest* httpRequest; ///< HTTP client request for detailing errors
8822ebee 53 StoreEntry* entry; ///< Store entry expecting the response
1b76e6c1 54 Comm::ConnectionPointer conn; ///< HTTP client connection descriptor
8822ebee 55 AsyncCall::Pointer closer; ///< comm_close handler for the HTTP connection
7e6eabbc 56 AccessLogEntryPointer ale; ///< more transaction details
8822ebee
AR
57};
58
59} // namespace Mgr
60
61#endif /* SQUID_MGR_FORWARDER_H */
f53969cc 62