]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/Port.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / Port.cc
index 1d8029cc2fc0273cd011a3b8978f3af29b56b4fb..88489dabeb7a45f507cd87c28370db20ff528ac2 100644 (file)
@@ -1,22 +1,28 @@
 /*
- * DEBUG: section 54    Interprocess Communication
+ * Copyright (C) 1996-2017 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 "comm/Connection.h"
 #include "comm/Read.h"
 #include "CommCalls.h"
-#include "globals.h"
 #include "ipc/Port.h"
+#include "tools.h"
+#include "util.h"
 
 static const char channelPathPfx[] = DEFAULT_STATEDIR "/";
 static const char coordinatorAddrLabel[] = "-coordinator";
 const char Ipc::strandAddrLabel[] =  "-kid";
 
 Ipc::Port::Port(const String& aListenAddr):
-        UdsOp(aListenAddr)
+    UdsOp(aListenAddr)
 {
     setOptions(COMM_NONBLOCKING | COMM_DOBIND);
 }
@@ -46,7 +52,7 @@ String Ipc::Port::MakeAddr(const char* processLabel, int id)
 {
     assert(id >= 0);
     String addr = channelPathPfx;
-    addr.append(service_name);
+    addr.append(service_name.c_str());
     addr.append(processLabel);
     addr.append('-');
     addr.append(xitoa(id));
@@ -60,7 +66,7 @@ Ipc::Port::CoordinatorAddr()
     static String coordinatorAddr;
     if (!coordinatorAddr.size()) {
         coordinatorAddr= channelPathPfx;
-        coordinatorAddr.append(service_name);
+        coordinatorAddr.append(service_name.c_str());
         coordinatorAddr.append(coordinatorAddrLabel);
         coordinatorAddr.append(".ipc");
     }
@@ -80,3 +86,4 @@ void Ipc::Port::noteRead(const CommIoCbParams& params)
 
     doListen();
 }
+