]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/SharedListen.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / SharedListen.cc
index 35b1db3c48f8eaa1e6a15deb3f9f8fed2a84326d..bfbf44925ff7b80058964bec11ddce166a678626 100644 (file)
@@ -1,18 +1,24 @@
 /*
- * DEBUG: section 54    Interprocess Communication
+ * 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.
  */
 
+/* DEBUG: section 54    Interprocess Communication */
+
 #include "squid.h"
-#include "comm.h"
 #include "base/TextException.h"
+#include "comm.h"
 #include "comm/Connection.h"
 #include "globals.h"
-#include "ipc/Port.h"
-#include "ipc/Messages.h"
 #include "ipc/Kids.h"
-#include "ipc/TypedMsgHdr.h"
-#include "ipc/StartListening.h"
+#include "ipc/Messages.h"
+#include "ipc/Port.h"
 #include "ipc/SharedListen.h"
+#include "ipc/StartListening.h"
+#include "ipc/TypedMsgHdr.h"
 #include "tools.h"
 
 #include <map>
@@ -45,7 +51,7 @@ AddToMap(const PendingOpenRequest &por)
 
 Ipc::OpenListenerParams::OpenListenerParams()
 {
-    xmemset(this, 0, sizeof(*this));
+    memset(this, 0, sizeof(*this));
 }
 
 bool
@@ -80,12 +86,12 @@ void Ipc::SharedListenRequest::pack(TypedMsgHdr &hdrMsg) const
 }
 
 Ipc::SharedListenResponse::SharedListenResponse(int aFd, int anErrNo, int aMapId):
-        fd(aFd), errNo(anErrNo), mapId(aMapId)
+    fd(aFd), errNo(anErrNo), mapId(aMapId)
 {
 }
 
 Ipc::SharedListenResponse::SharedListenResponse(const TypedMsgHdr &hdrMsg):
-        fd(-1), errNo(0), mapId(-1)
+    fd(-1), errNo(0), mapId(-1)
 {
     hdrMsg.checkType(mtSharedListenResponse);
     hdrMsg.getPod(*this);
@@ -117,7 +123,7 @@ void Ipc::JoinSharedListen(const OpenListenerParams &params,
 
     TypedMsgHdr message;
     request.pack(message);
-    SendMessage(coordinatorAddr, message);
+    SendMessage(Ipc::Port::CoordinatorAddr(), message);
 }
 
 void Ipc::SharedListenJoined(const SharedListenResponse &response)
@@ -142,14 +148,15 @@ void Ipc::SharedListenJoined(const SharedListenResponse &response)
         cbd->conn->flags = p.flags;
         // XXX: leave the comm AI stuff to comm_import_opened()?
         struct addrinfo *AI = NULL;
-        p.addr.GetAddrInfo(AI);
+        p.addr.getAddrInfo(AI);
         AI->ai_socktype = p.sock_type;
         AI->ai_protocol = p.proto;
         comm_import_opened(cbd->conn, FdNote(p.fdNote), AI);
-        p.addr.FreeAddrInfo(AI);
+        Ip::Address::FreeAddr(AI);
     }
 
     cbd->errNo = response.errNo;
     cbd->handlerSubscription = por.params.handlerSubscription;
     ScheduleCallHere(por.callback);
 }
+