/*
- * DEBUG: section 17 Request Forwarding
+ * 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 17 Request Forwarding */
+
#include "squid.h"
+#include "CollapsedForwarding.h"
+#include "globals.h"
#include "ipc/mem/Segment.h"
#include "ipc/Messages.h"
#include "ipc/Port.h"
#include "ipc/TypedMsgHdr.h"
#include "MemObject.h"
-#include "CollapsedForwarding.h"
-#include "globals.h"
#include "SquidConfig.h"
#include "Store.h"
#include "store_key_md5.h"
int sender; ///< kid ID of sending process
/// transients index, so that workers can find [private] entries to sync
- sfileno xitIndex;
+ sfileno xitIndex;
};
// CollapsedForwarding
return;
if (!e.mem_obj || e.mem_obj->xitTable.index < 0 ||
- !Store::Root().transientReaders(e)) {
+ !Store::Root().transientReaders(e)) {
debugs(17, 7, "nobody reads " << e);
return;
}
// TODO: Count and report the total number of notifications, pops, pushes.
debugs(17, 7, "to kid" << workerId);
Ipc::TypedMsgHdr msg;
- // TODO: add proper message type?
msg.setType(Ipc::mtCollapsedForwardingNotification);
msg.putInt(KidIdentifier);
- const String addr = Ipc::Port::MakeAddr(Ipc::strandAddrPfx, workerId);
+ const String addr = Ipc::Port::MakeAddr(Ipc::strandAddrLabel, workerId);
Ipc::SendMessage(addr, msg);
}
debugs(17, 7, "handled entry " << msg.xitIndex << " in transients_map");
// XXX: stop and schedule an async call to continue
- assert(++poppedCount < SQUID_MAXFD);
+ ++poppedCount;
+ assert(poppedCount < SQUID_MAXFD);
}
}
virtual ~CollapsedForwardingRr();
protected:
- virtual void create(const RunnerRegistry &);
- virtual void open(const RunnerRegistry &);
+ virtual void create();
+ virtual void open();
private:
Ipc::MultiQueue::Owner *owner;
};
-RunnerRegistrationEntry(rrAfterConfig, CollapsedForwardingRr);
+RunnerRegistrationEntry(CollapsedForwardingRr);
-void CollapsedForwardingRr::create(const RunnerRegistry &)
+void CollapsedForwardingRr::create()
{
Must(!owner);
owner = Ipc::MultiQueue::Init(ShmLabel, Config.workers, 1,
QueueCapacity);
}
-void CollapsedForwardingRr::open(const RunnerRegistry &)
+void CollapsedForwardingRr::open()
{
CollapsedForwarding::Init();
}
{
delete owner;
}
+