/* $ModDep: m_spanningtree/cachetimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h m_spanningtree/rsquit.h m_spanningtree/protocolinterface.h */
-ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me)
- : Module(Me), max_local(0), max_global(0)
+ModuleSpanningTree::ModuleSpanningTree()
+ : max_local(0), max_global(0)
{
ServerInstance->Modules->UseInterface("BufferedSocketHook");
- Utils = new SpanningTreeUtilities(ServerInstance, this);
+ Utils = new SpanningTreeUtilities(this);
command_rconnect = new CommandRConnect(this, Utils);
ServerInstance->AddCommand(command_rconnect);
command_rsquit = new CommandRSQuit(this, Utils);
ServerInstance->AddCommand(command_rsquit);
- RefreshTimer = new CacheRefreshTimer(ServerInstance, Utils);
+ RefreshTimer = new CacheRefreshTimer(Utils);
ServerInstance->Timers->AddTimer(RefreshTimer);
Implementation eventlist[] =
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
delete ServerInstance->PI;
- ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
+ ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils);
loopCall = false;
// update our local user count
/* Gave a hook, but it wasnt one we know */
if ((!x->Hook.empty()) && (Utils->hooks.find(x->Hook.c_str()) == Utils->hooks.end()))
return;
- TreeSocket* newsocket = new TreeSocket(Utils, ServerInstance, x->IPAddr,x->Port, x->Timeout ? x->Timeout : 10,x->Name.c_str(), x->Bind, y, x->Hook.empty() ? NULL : Utils->hooks[x->Hook.c_str()]);
+ TreeSocket* newsocket = new TreeSocket(Utils, x->IPAddr,x->Port, x->Timeout ? x->Timeout : 10,x->Name.c_str(), x->Bind, y, x->Hook.empty() ? NULL : Utils->hooks[x->Hook.c_str()]);
if (newsocket->GetFd() > -1)
{
/* Handled automatically on success */
else
{
ServerInstance->SNO->WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.",x->Name.c_str(),strerror(errno));
- if (ServerInstance->SocketCull.find(newsocket) == ServerInstance->SocketCull.end())
- ServerInstance->SocketCull[newsocket] = newsocket;
+ ServerInstance->GlobalCulls.AddItem(newsocket);
Utils->DoFailOver(y);
}
}
try
{
bool cached;
- ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, ServerInstance,x->IPAddr, *x, cached, start_type, y);
+ ServernameResolver* snr = new ServernameResolver((Module*)this, Utils, x->IPAddr, *x, cached, start_type, y);
ServerInstance->AddResolver(snr, cached);
}
catch (ModuleException& e)
ModuleSpanningTree::~ModuleSpanningTree()
{
delete ServerInstance->PI;
- ServerInstance->PI = new ProtocolInterface(ServerInstance);
+ ServerInstance->PI = new ProtocolInterface;
/* This will also free the listeners */
delete Utils;
Version ModuleSpanningTree::GetVersion()
{
- return Version("$Id$", VF_VENDOR, API_VERSION);
+ return Version("Allows servers to be linked", VF_VENDOR);
}
/* It is IMPORTANT that m_spanningtree is the last module in the chain