]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/FunAction.cc
Removed inclusion of protos.h from most clients.
[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 "Store.h"
18 #include "tools.h"
19
20 Mgr::FunAction::Pointer
21 Mgr::FunAction::Create(const Command::Pointer &aCmd, OBJH* aHandler)
22 {
23 return new FunAction(aCmd, aHandler);
24 }
25
26 Mgr::FunAction::FunAction(const Command::Pointer &aCmd, OBJH* aHandler):
27 Action(aCmd), handler(aHandler)
28 {
29 Must(handler != NULL);
30 debugs(16, 5, HERE);
31 }
32
33 void
34 Mgr::FunAction::respond(const Request& request)
35 {
36 debugs(16, 5, HERE);
37 Ipc::ImportFdIntoComm(request.conn, SOCK_STREAM, IPPROTO_TCP, Ipc::fdnHttpSocket);
38 Must(Comm::IsConnOpen(request.conn));
39 Must(request.requestId != 0);
40 AsyncJob::Start(new Mgr::Filler(this, request.conn, request.requestId));
41 }
42
43 void
44 Mgr::FunAction::dump(StoreEntry* entry)
45 {
46 debugs(16, 5, HERE);
47 Must(entry != NULL);
48 if (UsingSmp())
49 storeAppendPrintf(entry, "by kid%d {\n", KidIdentifier);
50 handler(entry);
51 if (atomic() && UsingSmp())
52 storeAppendPrintf(entry, "} by kid%d\n\n", KidIdentifier);
53 }