]> git.ipfire.org Git - thirdparty/squid.git/blame - src/mgr/FunAction.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / mgr / FunAction.cc
CommitLineData
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"
582c2af2 11#include "globals.h"
51ea0904 12#include "ipc/UdsOp.h"
8822ebee
AR
13#include "mgr/Command.h"
14#include "mgr/Filler.h"
15#include "mgr/FunAction.h"
16#include "mgr/Request.h"
582c2af2 17#include "protos.h"
8822ebee
AR
18#include "Store.h"
19
8822ebee
AR
20Mgr::FunAction::Pointer
21Mgr::FunAction::Create(const Command::Pointer &aCmd, OBJH* aHandler)
22{
23 return new FunAction(aCmd, aHandler);
24}
25
26Mgr::FunAction::FunAction(const Command::Pointer &aCmd, OBJH* aHandler):
d9fc6862 27 Action(aCmd), handler(aHandler)
8822ebee
AR
28{
29 Must(handler != NULL);
30 debugs(16, 5, HERE);
31}
32
33void
34Mgr::FunAction::respond(const Request& request)
35{
36 debugs(16, 5, HERE);
1b76e6c1
AJ
37 Ipc::ImportFdIntoComm(request.conn, SOCK_STREAM, IPPROTO_TCP, Ipc::fdnHttpSocket);
38 Must(Comm::IsConnOpen(request.conn));
8822ebee 39 Must(request.requestId != 0);
1b76e6c1 40 AsyncJob::Start(new Mgr::Filler(this, request.conn, request.requestId));
8822ebee
AR
41}
42
43void
44Mgr::FunAction::dump(StoreEntry* entry)
45{
46 debugs(16, 5, HERE);
47 Must(entry != NULL);
39c1e1d9 48 if (UsingSmp())
8822ebee
AR
49 storeAppendPrintf(entry, "by kid%d {\n", KidIdentifier);
50 handler(entry);
39c1e1d9 51 if (atomic() && UsingSmp())
8822ebee
AR
52 storeAppendPrintf(entry, "} by kid%d\n\n", KidIdentifier);
53}