]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Request.cc
4 * DEBUG: section 16 Cache Manager API
9 #include "base/TextException.h"
10 #include "comm/Connection.h"
11 #include "ipc/Messages.h"
12 #include "ipc/TypedMsgHdr.h"
13 #include "mgr/ActionParams.h"
14 #include "mgr/Request.h"
16 Mgr::Request::Request(int aRequestorId
, unsigned int aRequestId
, const Comm::ConnectionPointer
&aConn
,
17 const ActionParams
&aParams
):
18 Ipc::Request(aRequestorId
, aRequestId
),
22 Must(requestorId
> 0);
25 Mgr::Request::Request(const Request
& request
):
26 Ipc::Request(request
.requestorId
, request
.requestId
),
27 conn(request
.conn
), params(request
.params
)
31 Mgr::Request::Request(const Ipc::TypedMsgHdr
& msg
):
34 msg
.checkType(Ipc::mtCacheMgrRequest
);
35 msg
.getPod(requestorId
);
36 msg
.getPod(requestId
);
37 params
= ActionParams(msg
);
39 conn
= new Comm::Connection
;
40 conn
->fd
= msg
.getFd();
41 // For now we just have the FD.
42 // Address and connectio details wil be pulled/imported by the component later
46 Mgr::Request::pack(Ipc::TypedMsgHdr
& msg
) const
48 msg
.setType(Ipc::mtCacheMgrRequest
);
49 msg
.putPod(requestorId
);
50 msg
.putPod(requestId
);
57 Mgr::Request::clone() const
59 return new Request(*this);