]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Response.cc
2 * DEBUG: section 16 Cache Manager API
7 #include "base/TextException.h"
8 #include "CacheManager.h"
9 #include "ipc/Messages.h"
10 #include "ipc/TypedMsgHdr.h"
11 #include "mgr/ActionCreator.h"
12 #include "mgr/ActionProfile.h"
13 #include "mgr/Response.h"
15 Mgr::Response::Response(unsigned int aRequestId
, Action::Pointer anAction
):
16 Ipc::Response(aRequestId
), action(anAction
)
18 Must(!action
|| action
->name()); // if there is an action, it must be named
21 Mgr::Response::Response(const Response
& response
):
22 Ipc::Response(response
.requestId
), action(response
.action
)
26 Mgr::Response::Response(const Ipc::TypedMsgHdr
& msg
):
29 msg
.checkType(Ipc::mtCacheMgrResponse
);
30 msg
.getPod(requestId
);
33 if (msg
.hasMoreData()) {
35 msg
.getString(actionName
);
36 action
= CacheManager::GetInstance()->createNamedAction(actionName
.termedBuf());
43 Mgr::Response::pack(Ipc::TypedMsgHdr
& msg
) const
46 msg
.setType(Ipc::mtCacheMgrResponse
);
47 msg
.putPod(requestId
);
49 msg
.putString(action
->name());
54 Ipc::Response::Pointer
55 Mgr::Response::clone() const
57 return new Response(*this);
61 Mgr::Response::hasAction() const
63 return action
!= NULL
;
67 Mgr::Response::getAction() const