]>
Commit | Line | Data |
---|---|---|
8822ebee | 1 | /* |
8822ebee AR |
2 | * DEBUG: section 16 Cache Manager API |
3 | * | |
4 | */ | |
5 | ||
f7f3304a | 6 | #include "squid.h" |
8822ebee | 7 | #include "base/TextException.h" |
c3e8e4e9 | 8 | #include "comm/Connection.h" |
582c2af2 | 9 | #include "globals.h" |
51ea0904 | 10 | #include "ipc/UdsOp.h" |
8822ebee AR |
11 | #include "mgr/Command.h" |
12 | #include "mgr/Filler.h" | |
13 | #include "mgr/FunAction.h" | |
14 | #include "mgr/Request.h" | |
15 | #include "Store.h" | |
5bed43d6 | 16 | #include "tools.h" |
8822ebee | 17 | |
8822ebee AR |
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): | |
d9fc6862 | 25 | Action(aCmd), handler(aHandler) |
8822ebee AR |
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); | |
1b76e6c1 AJ |
35 | Ipc::ImportFdIntoComm(request.conn, SOCK_STREAM, IPPROTO_TCP, Ipc::fdnHttpSocket); |
36 | Must(Comm::IsConnOpen(request.conn)); | |
8822ebee | 37 | Must(request.requestId != 0); |
1b76e6c1 | 38 | AsyncJob::Start(new Mgr::Filler(this, request.conn, request.requestId)); |
8822ebee AR |
39 | } |
40 | ||
41 | void | |
42 | Mgr::FunAction::dump(StoreEntry* entry) | |
43 | { | |
44 | debugs(16, 5, HERE); | |
45 | Must(entry != NULL); | |
39c1e1d9 | 46 | if (UsingSmp()) |
8822ebee AR |
47 | storeAppendPrintf(entry, "by kid%d {\n", KidIdentifier); |
48 | handler(entry); | |
39c1e1d9 | 49 | if (atomic() && UsingSmp()) |
8822ebee AR |
50 | storeAppendPrintf(entry, "} by kid%d\n\n", KidIdentifier); |
51 | } |