]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/Port.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / Port.cc
index 4556f0590c3f573f9352154c3034f0495049a694..927252ce26308c163fcd8354a3efca751494047f 100644 (file)
@@ -1,19 +1,16 @@
 /*
- * $Id$
- *
  * DEBUG: section 54    Interprocess Communication
  *
  */
 
-#include "config.h"
+#include "squid.h"
 #include "comm.h"
-#include "CommCalls.h"
 #include "comm/Connection.h"
+#include "CommCalls.h"
 #include "ipc/Port.h"
 
-const char Ipc::coordinatorAddr[] = DEFAULT_PREFIX "/var/run/coordinator.ipc";
-const char Ipc::strandAddrPfx[] = DEFAULT_PREFIX "/var/run/squid";
-
+const char Ipc::coordinatorAddr[] = DEFAULT_STATEDIR "/coordinator.ipc";
+const char Ipc::strandAddrPfx[] = DEFAULT_STATEDIR "/kid";
 
 Ipc::Port::Port(const String& aListenAddr):
         UdsOp(aListenAddr)
@@ -24,17 +21,17 @@ Ipc::Port::Port(const String& aListenAddr):
 void Ipc::Port::start()
 {
     UdsOp::start();
-    listen();
+    doListen();
 }
 
-void Ipc::Port::listen()
+void Ipc::Port::doListen()
 {
     debugs(54, 6, HERE);
     buf.prepForReading();
     typedef CommCbMemFunT<Port, CommIoCbParams> Dialer;
     AsyncCall::Pointer readHandler = JobCallback(54, 6,
                                      Dialer, this, Port::noteRead);
-    comm_read(fd(), buf.raw(), buf.size(), readHandler);
+    comm_read(conn(), buf.raw(), buf.size(), readHandler);
 }
 
 bool Ipc::Port::doneAll() const
@@ -54,7 +51,7 @@ String Ipc::Port::MakeAddr(const char* pathAddr, int id)
 
 void Ipc::Port::noteRead(const CommIoCbParams& params)
 {
-    debugs(54, 6, HERE << "FD " << params.fd << " flag " << params.flag <<
+    debugs(54, 6, HERE << params.conn << " flag " << params.flag <<
            " [" << this << ']');
     if (params.flag == COMM_OK) {
         assert(params.buf == buf.raw());
@@ -63,5 +60,5 @@ void Ipc::Port::noteRead(const CommIoCbParams& params)
     // TODO: if there was a fatal error on our socket, close the socket before
     // trying to listen again and print a level-1 error message.
 
-    listen();
+    doListen();
 }