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