]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Request.cc
2 * Copyright (C) 1996-2023 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"
14 #include "ipc/Messages.h"
15 #include "ipc/TypedMsgHdr.h"
16 #include "mgr/ActionParams.h"
17 #include "mgr/Request.h"
19 Mgr::Request::Request(const int aRequestorId
,
20 const Ipc::RequestId aRequestId
,
21 const Comm::ConnectionPointer
&aConn
,
22 const ActionParams
&aParams
):
23 Ipc::Request(aRequestorId
, aRequestId
),
27 Must(requestorId
> 0);
30 Mgr::Request::Request(const Ipc::TypedMsgHdr
&msg
)
32 msg
.checkType(Ipc::mtCacheMgrRequest
);
33 msg
.getPod(requestorId
);
34 msg
.getPod(requestId
);
35 params
= ActionParams(msg
);
37 conn
= new Comm::Connection
;
38 conn
->fd
= msg
.getFd();
39 // For now we just have the FD.
40 // Address and connectio details wil be pulled/imported by the component later
44 Mgr::Request::pack(Ipc::TypedMsgHdr
& msg
) const
46 msg
.setType(Ipc::mtCacheMgrRequest
);
47 msg
.putPod(requestorId
);
48 msg
.putPod(requestId
);
55 Mgr::Request::clone() const
57 return new Request(*this);