*
*/
-#include "config.h"
+#include "squid.h"
#include "base/TextException.h"
+#include "comm/Connection.h"
#include "ipc/Messages.h"
+#include "ipc/TypedMsgHdr.h"
#include "mgr/ActionParams.h"
#include "mgr/Request.h"
-
-Mgr::Request::Request(int aRequestorId, unsigned int aRequestId, int aFd,
+Mgr::Request::Request(int aRequestorId, unsigned int aRequestId, const Comm::ConnectionPointer &aConn,
const ActionParams &aParams):
- requestorId(aRequestorId), requestId(aRequestId),
- fd(aFd), params(aParams)
+ Ipc::Request(aRequestorId, aRequestId),
+ conn(aConn),
+ params(aParams)
{
Must(requestorId > 0);
- Must(requestId != 0);
}
-Mgr::Request::Request(const Ipc::TypedMsgHdr& msg)
+Mgr::Request::Request(const Request& request):
+ Ipc::Request(request.requestorId, request.requestId),
+ conn(request.conn), params(request.params)
+{
+}
+
+Mgr::Request::Request(const Ipc::TypedMsgHdr& msg):
+ Ipc::Request(0, 0)
{
msg.checkType(Ipc::mtCacheMgrRequest);
msg.getPod(requestorId);
msg.getPod(requestId);
params = ActionParams(msg);
- fd = msg.getFd();
+ conn = new Comm::Connection;
+ conn->fd = msg.getFd();
+ // For now we just have the FD.
+ // Address and connectio details wil be pulled/imported by the component later
}
void
msg.putPod(requestId);
params.pack(msg);
- msg.putFd(fd);
+ msg.putFd(conn->fd);
+}
+
+Ipc::Request::Pointer
+Mgr::Request::clone() const
+{
+ return new Request(*this);
}