]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/FunAction.cc
merge from SslServerCertValidator r12332
[thirdparty/squid.git] / src / mgr / FunAction.cc
1 /*
2 * DEBUG: section 16 Cache Manager API
3 *
4 */
5
6 #include "squid.h"
7 #include "base/TextException.h"
8 #include "comm/Connection.h"
9 #include "globals.h"
10 #include "ipc/UdsOp.h"
11 #include "mgr/Command.h"
12 #include "mgr/Filler.h"
13 #include "mgr/FunAction.h"
14 #include "mgr/Request.h"
15 #include "Store.h"
16 #include "tools.h"
17
18 Mgr::FunAction::Pointer
19 Mgr::FunAction::Create(const Command::Pointer &aCmd, OBJH* aHandler)
20 {
21 return new FunAction(aCmd, aHandler);
22 }
23
24 Mgr::FunAction::FunAction(const Command::Pointer &aCmd, OBJH* aHandler):
25 Action(aCmd), handler(aHandler)
26 {
27 Must(handler != NULL);
28 debugs(16, 5, HERE);
29 }
30
31 void
32 Mgr::FunAction::respond(const Request& request)
33 {
34 debugs(16, 5, HERE);
35 Ipc::ImportFdIntoComm(request.conn, SOCK_STREAM, IPPROTO_TCP, Ipc::fdnHttpSocket);
36 Must(Comm::IsConnOpen(request.conn));
37 Must(request.requestId != 0);
38 AsyncJob::Start(new Mgr::Filler(this, request.conn, request.requestId));
39 }
40
41 void
42 Mgr::FunAction::dump(StoreEntry* entry)
43 {
44 debugs(16, 5, HERE);
45 Must(entry != NULL);
46 if (UsingSmp())
47 storeAppendPrintf(entry, "by kid%d {\n", KidIdentifier);
48 handler(entry);
49 if (atomic() && UsingSmp())
50 storeAppendPrintf(entry, "} by kid%d\n\n", KidIdentifier);
51 }