]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mgr/Request.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / mgr / Request.cc
index 9e6f76e83477be681347735d9a1935e79d91b9ca..3077708b64837f1e1256f07c191b6d7020b413c3 100644 (file)
@@ -1,41 +1,48 @@
 /*
- * $Id$
- *
- * DEBUG: section 16    Cache Manager API
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
  *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
-#include "config.h"
+/* DEBUG: section 16    Cache Manager API */
+
+#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):
-        Ipc::Request(aRequestorId, aRequestId),
-        fd(aFd), params(aParams)
+    Ipc::Request(aRequestorId, aRequestId),
+    conn(aConn),
+    params(aParams)
 {
     Must(requestorId > 0);
 }
 
 Mgr::Request::Request(const Request& request):
-        Ipc::Request(request.requestorId, request.requestId),
-        fd(request.fd), params(request.params)
+    Ipc::Request(request.requestorId, request.requestId),
+    conn(request.conn), params(request.params)
 {
 }
 
 Mgr::Request::Request(const Ipc::TypedMsgHdr& msg):
-        Ipc::Request(0, 0)
+    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
@@ -46,7 +53,7 @@ Mgr::Request::pack(Ipc::TypedMsgHdr& msg) const
     msg.putPod(requestId);
     params.pack(msg);
 
-    msg.putFd(fd);
+    msg.putFd(conn->fd);
 }
 
 Ipc::Request::Pointer
@@ -54,3 +61,4 @@ Mgr::Request::clone() const
 {
     return new Request(*this);
 }
+