]>
Commit | Line | Data |
---|---|---|
8822ebee AR |
1 | /* |
2 | * $Id$ | |
3 | * | |
4 | * DEBUG: section 16 Cache Manager API | |
5 | * | |
6 | */ | |
7 | ||
8 | #include "config.h" | |
9 | #include "base/TextException.h" | |
c3e8e4e9 | 10 | #include "comm/Connection.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" | |
16 | ||
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): | |
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); | |
c3e8e4e9 AJ |
35 | const Comm::ConnectionPointer client = ImportHttpFdIntoComm(request.fd); |
36 | Must(Comm::IsConnOpen(client)); | |
8822ebee | 37 | Must(request.requestId != 0); |
c3e8e4e9 | 38 | AsyncJob::Start(new Mgr::Filler(this, client, request.requestId)); |
8822ebee AR |
39 | } |
40 | ||
41 | void | |
42 | Mgr::FunAction::dump(StoreEntry* entry) | |
43 | { | |
44 | debugs(16, 5, HERE); | |
45 | Must(entry != NULL); | |
46 | if (UsingSmp() && IamWorkerProcess()) | |
47 | storeAppendPrintf(entry, "by kid%d {\n", KidIdentifier); | |
48 | handler(entry); | |
49 | if (atomic() && UsingSmp() && IamWorkerProcess()) | |
50 | storeAppendPrintf(entry, "} by kid%d\n\n", KidIdentifier); | |
51 | } |