/*
- * $Id$
- *
* DEBUG: section 54 Interprocess Communication
*
*/
-#include "config.h"
+#include "squid.h"
#include "base/Subscription.h"
#include "base/TextException.h"
+#include "CacheManager.h"
#include "comm/Connection.h"
-#include "ipc/Strand.h"
-#include "ipc/StrandCoord.h"
+#include "globals.h"
+#include "ipc/Kids.h"
#include "ipc/Messages.h"
#include "ipc/SharedListen.h"
-#include "ipc/Kids.h"
+#include "ipc/Strand.h"
+#include "ipc/StrandCoord.h"
+#include "ipc/StrandSearch.h"
+#include "mgr/Forwarder.h"
#include "mgr/Request.h"
#include "mgr/Response.h"
-#include "mgr/Forwarder.h"
-#include "CacheManager.h"
+#include "SwapDir.h" /* XXX: scope boundary violation */
+#if USE_DISKIO_IPCIO
+#include "DiskIO/IpcIo/IpcIoFile.h" /* XXX: scope boundary violation */
+#endif
#if SQUID_SNMP
#include "snmp/Forwarder.h"
#include "snmp/Request.h"
CBDATA_NAMESPACED_CLASS_INIT(Ipc, Strand);
-
Ipc::Strand::Strand():
Port(MakeAddr(strandAddrPfx, KidIdentifier)),
isRegistered(false)
{
debugs(54, 6, HERE);
Must(!isRegistered);
+
+ HereIamMessage ann(StrandCoord(KidIdentifier, getpid()));
TypedMsgHdr message;
- StrandCoord(KidIdentifier, getpid()).pack(message);
+ ann.pack(message);
SendMessage(coordinatorAddr, message);
setTimeout(6, "Ipc::Strand::timeoutHandler"); // TODO: make 6 configurable?
}
switch (message.type()) {
case mtRegistration:
- handleRegistrationResponse(StrandCoord(message));
+ handleRegistrationResponse(HereIamMessage(message));
break;
case mtSharedListenResponse:
SharedListenJoined(SharedListenResponse(message));
break;
+#if USE_DISKIO_IPCIO
+ case mtStrandSearchResponse:
+ IpcIoFile::HandleOpenResponse(StrandSearchResponse(message));
+ break;
+
+ case mtIpcIoNotification:
+ IpcIoFile::HandleNotification(message);
+ break;
+#endif /* USE_DISKIO_IPCIO */
+
case mtCacheMgrRequest: {
const Mgr::Request req(message);
handleCacheMgrRequest(req);
#endif
default:
- debugs(54, 1, HERE << "Unhandled message type: " << message.type());
+ debugs(54, DBG_IMPORTANT, HERE << "Unhandled message type: " << message.type());
break;
}
}
-void Ipc::Strand::handleRegistrationResponse(const StrandCoord &strand)
+void Ipc::Strand::handleRegistrationResponse(const HereIamMessage &msg)
{
// handle registration response from the coordinator; it could be stale
- if (strand.kidId == KidIdentifier && strand.pid == getpid()) {
+ if (msg.strand.kidId == KidIdentifier && msg.strand.pid == getpid()) {
debugs(54, 6, "kid" << KidIdentifier << " registered");
clearTimeout(); // we are done
} else {