]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Inquirer.h
merge from SslServerCertValidator r12332
[thirdparty/squid.git] / src / mgr / Inquirer.h
1 /*
2 * DEBUG: section 16 Cache Manager API
3 *
4 */
5
6 #ifndef SQUID_MGR_INQUIRER_H
7 #define SQUID_MGR_INQUIRER_H
8
9 #include "comm/forward.h"
10 #include "ipc/Inquirer.h"
11 #include "mgr/Action.h"
12
13 class CommIoCbParams;
14 class CommCloseCbParams;
15
16 namespace Mgr
17 {
18
19 /// Coordinator's job that sends a cache manage request to each strand,
20 /// aggregating individual strand responses and dumping the result if needed
21 class Inquirer: public Ipc::Inquirer
22 {
23 public:
24 Inquirer(Action::Pointer anAction, const Request &aCause,
25 const Ipc::StrandCoords &coords);
26
27 protected:
28 /* AsyncJob API */
29 virtual void start();
30 virtual bool doneAll() const;
31
32 /* Ipc::Inquirer API */
33 virtual void cleanup();
34 virtual void sendResponse();
35 virtual bool aggregate(Ipc::Response::Pointer aResponse);
36
37 private:
38 void noteWroteHeader(const CommIoCbParams& params);
39 void noteCommClosed(const CommCloseCbParams& params);
40 void removeCloseHandler();
41 Ipc::StrandCoords applyQueryParams(const Ipc::StrandCoords& aStrands,
42 const QueryParams& aParams);
43 private:
44 Action::Pointer aggrAction; //< action to aggregate
45
46 Comm::ConnectionPointer conn; ///< HTTP client socket descriptor
47
48 AsyncCall::Pointer writer; ///< comm_write callback
49 AsyncCall::Pointer closer; ///< comm_close handler
50
51 CBDATA_CLASS2(Inquirer);
52 };
53
54 } // namespace Mgr
55
56 #endif /* SQUID_MGR_INQUIRER_H */