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