]>
Commit | Line | Data |
---|---|---|
8822ebee | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
8822ebee | 3 | * |
bbc27441 AJ |
4 | * Squid software is distributed under GPLv2+ license and includes |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
8822ebee AR |
7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 16 Cache Manager API */ |
10 | ||
f7f3304a | 11 | #include "squid.h" |
8822ebee | 12 | #include "base/TextException.h" |
c3e8e4e9 | 13 | #include "comm/Connection.h" |
582c2af2 | 14 | #include "globals.h" |
51ea0904 | 15 | #include "ipc/UdsOp.h" |
8822ebee AR |
16 | #include "mgr/Command.h" |
17 | #include "mgr/Filler.h" | |
18 | #include "mgr/FunAction.h" | |
19 | #include "mgr/Request.h" | |
20 | #include "Store.h" | |
5bed43d6 | 21 | #include "tools.h" |
8822ebee | 22 | |
8822ebee AR |
23 | Mgr::FunAction::Pointer |
24 | Mgr::FunAction::Create(const Command::Pointer &aCmd, OBJH* aHandler) | |
25 | { | |
26 | return new FunAction(aCmd, aHandler); | |
27 | } | |
28 | ||
29 | Mgr::FunAction::FunAction(const Command::Pointer &aCmd, OBJH* aHandler): | |
f53969cc | 30 | Action(aCmd), handler(aHandler) |
8822ebee AR |
31 | { |
32 | Must(handler != NULL); | |
33 | debugs(16, 5, HERE); | |
34 | } | |
35 | ||
36 | void | |
37 | Mgr::FunAction::respond(const Request& request) | |
38 | { | |
39 | debugs(16, 5, HERE); | |
1b76e6c1 AJ |
40 | Ipc::ImportFdIntoComm(request.conn, SOCK_STREAM, IPPROTO_TCP, Ipc::fdnHttpSocket); |
41 | Must(Comm::IsConnOpen(request.conn)); | |
8822ebee | 42 | Must(request.requestId != 0); |
1b76e6c1 | 43 | AsyncJob::Start(new Mgr::Filler(this, request.conn, request.requestId)); |
8822ebee AR |
44 | } |
45 | ||
46 | void | |
47 | Mgr::FunAction::dump(StoreEntry* entry) | |
48 | { | |
49 | debugs(16, 5, HERE); | |
50 | Must(entry != NULL); | |
39c1e1d9 | 51 | if (UsingSmp()) |
8822ebee AR |
52 | storeAppendPrintf(entry, "by kid%d {\n", KidIdentifier); |
53 | handler(entry); | |
39c1e1d9 | 54 | if (atomic() && UsingSmp()) |
8822ebee AR |
55 | storeAppendPrintf(entry, "} by kid%d\n\n", KidIdentifier); |
56 | } | |
f53969cc | 57 |