- /* The failover for this server is currently a member of the network.
- * The failover probably succeeded, where the main link did not.
- * Don't try the main link until the failover is gone again.
- */
- continue;
+ // found something in this block. Should the server fail,
+ // we want to start at the start of the list, not in the
+ // middle where we left off
+ x->position = -1;
+ goto dupe_found; // next autoconnect block
}
}
- if (!CheckDupe)
- {
- // an autoconnected server is not connected. Check if its time to connect it
- ServerInstance->SNO->WriteToSnoMask('l',"AUTOCONNECT: Auto-connecting server \002%s\002 (%lu seconds until next attempt)",y->Name.c_str(),x->Period);
+ if ((!L->Hook.empty()) && (hooks.find(L->Hook.c_str()) == hooks.end()))
{
- throw CoreException("Can't find transport type '"+L.Hook+"' for link '"+assign(L.Name)+"' - maybe you forgot to load it BEFORE m_spanningtree in your config file? Skipping <link> tag completely.");
+ throw CoreException("Can't find transport type '"+L->Hook+"' for link '"+assign(L->Name)+"' - maybe you forgot to load it BEFORE m_spanningtree in your config file? Skipping <link> tag completely.");
continue;
}
- if (L.Name.find('.') == std::string::npos)
- throw CoreException("The link name '"+assign(L.Name)+"' is invalid and must contain at least one '.' character");
+ if (L->Name.find('.') == std::string::npos)
+ throw CoreException("The link name '"+assign(L->Name)+"' is invalid and must contain at least one '.' character");
- if (L.Name.length() > 64)
- throw CoreException("The link name '"+assign(L.Name)+"' is longer than 64 characters!");
+ if (L->Name.length() > 64)
+ throw CoreException("The link name '"+assign(L->Name)+"' is longer than 64 characters!");
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want.");
+ ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L->Name) + " has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want.");
}
- if (L.RecvPass.empty())
+ if (L->RecvPass.empty())
{
- throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', recvpass not defined!");
+ throw CoreException("Invalid configuration for server '"+assign(L->Name)+"', recvpass not defined!");
}
- if (L.SendPass.empty())
+ if (L->SendPass.empty())
{
- throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', sendpass not defined!");
+ throw CoreException("Invalid configuration for server '"+assign(L->Name)+"', sendpass not defined!");
}
- if (L.Name.empty())
+ if (L->Name.empty())
{
- throw CoreException("Invalid configuration, link tag without a name! IP address: "+L.IPAddr);
+ throw CoreException("Invalid configuration, link tag without a name! IP address: "+L->IPAddr);
}
- if (!L.Port)
+ if (!L->Port)
{
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no port defined, you will not be able to /connect it.");
+ ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L->Name) + " has no port defined, you will not be able to /connect it.");
- ServerInstance->SNO->WriteToSnoMask('l', "FAILOVER: Some muppet configured the failover for server \002%s\002 to point at itself. Not following it!", x->Server.c_str());