]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/Strand.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / ipc / Strand.cc
index 3b8a39c12a449ba7072594ce531856a310e22ccd..420cb69233524d54cdca9c7cb646c83b7b0ab38c 100644 (file)
@@ -1,26 +1,31 @@
 /*
- * $Id$
- *
- * 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.
  */
 
-#include "config.h"
+/* DEBUG: section 54    Interprocess Communication */
+
+#include "squid.h"
 #include "base/Subscription.h"
 #include "base/TextException.h"
+#include "CacheManager.h"
+#include "CollapsedForwarding.h"
 #include "comm/Connection.h"
-#include "ipc/Strand.h"
-#include "ipc/StrandCoord.h"
+#include "fatal.h"
+#include "globals.h"
+#include "ipc/Kids.h"
 #include "ipc/Messages.h"
 #include "ipc/SharedListen.h"
+#include "ipc/Strand.h"
+#include "ipc/StrandCoord.h"
 #include "ipc/StrandSearch.h"
-#include "ipc/Kids.h"
+#include "mgr/Forwarder.h"
 #include "mgr/Request.h"
 #include "mgr/Response.h"
-#include "mgr/Forwarder.h"
-#include "SwapDir.h" /* XXX: scope boundary violation */
-#include "CacheManager.h"
-#if USE_DISKIO_IPCIO
+#if HAVE_DISKIO_MODULE_IPCIO
 #include "DiskIO/IpcIo/IpcIoFile.h" /* XXX: scope boundary violation */
 #endif
 #if SQUID_SNMP
 
 CBDATA_NAMESPACED_CLASS_INIT(Ipc, Strand);
 
-
 Ipc::Strand::Strand():
-        Port(MakeAddr(strandAddrPfx, KidIdentifier)),
-        isRegistered(false)
+    Port(MakeAddr(strandAddrLabel, KidIdentifier)),
+    isRegistered(false)
 {
 }
 
@@ -52,7 +56,7 @@ void Ipc::Strand::registerSelf()
     HereIamMessage ann(StrandCoord(KidIdentifier, getpid()));
     TypedMsgHdr message;
     ann.pack(message);
-    SendMessage(coordinatorAddr, message);
+    SendMessage(Port::CoordinatorAddr(), message);
     setTimeout(6, "Ipc::Strand::timeoutHandler"); // TODO: make 6 configurable?
 }
 
@@ -69,7 +73,7 @@ void Ipc::Strand::receive(const TypedMsgHdr &message)
         SharedListenJoined(SharedListenResponse(message));
         break;
 
-#if USE_DISKIO_IPCIO
+#if HAVE_DISKIO_MODULE_IPCIO
     case mtStrandSearchResponse:
         IpcIoFile::HandleOpenResponse(StrandSearchResponse(message));
         break;
@@ -77,7 +81,7 @@ void Ipc::Strand::receive(const TypedMsgHdr &message)
     case mtIpcIoNotification:
         IpcIoFile::HandleNotification(message);
         break;
-#endif /* USE_DISKIO_IPCIO */
+#endif /* HAVE_DISKIO_MODULE_IPCIO */
 
     case mtCacheMgrRequest: {
         const Mgr::Request req(message);
@@ -91,6 +95,10 @@ void Ipc::Strand::receive(const TypedMsgHdr &message)
     }
     break;
 
+    case mtCollapsedForwardingNotification:
+        CollapsedForwarding::HandleNotification(message);
+        break;
+
 #if SQUID_SNMP
     case mtSnmpRequest: {
         const Snmp::Request req(message);
@@ -106,7 +114,7 @@ void Ipc::Strand::receive(const TypedMsgHdr &message)
 #endif
 
     default:
-        debugs(54, 1, HERE << "Unhandled message type: " << message.type());
+        debugs(54, DBG_IMPORTANT, HERE << "Unhandled message type: " << message.type());
         break;
     }
 }
@@ -156,3 +164,4 @@ void Ipc::Strand::timedout()
     if (!isRegistered)
         fatalf("kid%d registration timed out", KidIdentifier);
 }
+