]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/FunAction.cc
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
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.
9 /* DEBUG: section 16 Cache Manager API */
12 #include "base/TextException.h"
13 #include "comm/Connection.h"
15 #include "ipc/RequestId.h"
16 #include "ipc/UdsOp.h"
17 #include "mgr/Command.h"
18 #include "mgr/Filler.h"
19 #include "mgr/FunAction.h"
20 #include "mgr/Request.h"
24 Mgr::FunAction::Pointer
25 Mgr::FunAction::Create(const Command::Pointer
&aCmd
, OBJH
* aHandler
)
27 return new FunAction(aCmd
, aHandler
);
30 Mgr::FunAction::FunAction(const Command::Pointer
&aCmd
, OBJH
* aHandler
):
31 Action(aCmd
), handler(aHandler
)
33 Must(handler
!= nullptr);
34 debugs(16, 5, MYNAME
);
38 Mgr::FunAction::respond(const Request
& request
)
40 debugs(16, 5, MYNAME
);
41 Ipc::ImportFdIntoComm(request
.conn
, SOCK_STREAM
, IPPROTO_TCP
, Ipc::fdnHttpSocket
);
42 Must(Comm::IsConnOpen(request
.conn
));
43 Must(request
.requestId
!= 0);
44 AsyncJob::Start(new Mgr::Filler(this, request
.conn
, request
.requestId
));
48 Mgr::FunAction::dump(StoreEntry
* entry
)
50 debugs(16, 5, MYNAME
);
51 Must(entry
!= nullptr);
53 storeAppendPrintf(entry
, "by kid%d {\n", KidIdentifier
);
55 if (atomic() && UsingSmp())
56 storeAppendPrintf(entry
, "} by kid%d\n\n", KidIdentifier
);