]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/Request.cc
2 * Copyright (C) 1996-2015 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(int aRequestorId
, unsigned int aRequestId
, const Comm::ConnectionPointer
&aConn
,
20 const ActionParams
&aParams
):
21 Ipc::Request(aRequestorId
, aRequestId
),
25 Must(requestorId
> 0);
28 Mgr::Request::Request(const Request
& request
):
29 Ipc::Request(request
.requestorId
, request
.requestId
),
30 conn(request
.conn
), params(request
.params
)
34 Mgr::Request::Request(const Ipc::TypedMsgHdr
& msg
):
37 msg
.checkType(Ipc::mtCacheMgrRequest
);
38 msg
.getPod(requestorId
);
39 msg
.getPod(requestId
);
40 params
= ActionParams(msg
);
42 conn
= new Comm::Connection
;
43 conn
->fd
= msg
.getFd();
44 // For now we just have the FD.
45 // Address and connectio details wil be pulled/imported by the component later
49 Mgr::Request::pack(Ipc::TypedMsgHdr
& msg
) const
51 msg
.setType(Ipc::mtCacheMgrRequest
);
52 msg
.putPod(requestorId
);
53 msg
.putPod(requestId
);
60 Mgr::Request::clone() const
62 return new Request(*this);