From 78aabc62e7510af5075b2056f703f0aa42e328a4 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 30 Sep 2009 21:55:31 +0000 Subject: Allow multiple autoconnects in a single tag, fix infinite failover git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11786 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket1.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/modules/m_spanningtree/treesocket1.cpp') diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 6bb736a85..46effe48c 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -66,7 +66,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, int newfd, char* ip, Autocon if (HookMod) BufferedSocketHookRequest(this, Utils->Creator, HookMod).Send(); - hstimer = new HandshakeTimer(this, &(Utils->LinkBlocks[0]), this->Utils, 1); + hstimer = new HandshakeTimer(this, Utils->LinkBlocks[0], this->Utils, 1); ServerInstance->Timers->AddTimer(hstimer); /* Fix by Brain - inbound sockets need a timeout, too. 30 secs should be pleanty */ @@ -108,8 +108,9 @@ void TreeSocket::OnConnected() if (this->LinkState == CONNECTING) { /* we do not need to change state here. */ - for (std::vector::iterator x = Utils->LinkBlocks.begin(); x < Utils->LinkBlocks.end(); x++) + for (std::vector >::iterator i = Utils->LinkBlocks.begin(); i < Utils->LinkBlocks.end(); ++i) { + Link* x = *i; if (x->Name == this->myhost) { ServerInstance->SNO->WriteToSnoMask('l', "Connection to \2%s\2[%s] started.", myhost.c_str(), (x->HiddenFromStats ? "" : this->IP.c_str())); @@ -140,7 +141,7 @@ void TreeSocket::OnError(BufferedSocketError e) { case I_ERR_CONNECT: ServerInstance->SNO->WriteToSnoMask('l', "Connection failed: Connection to \002%s\002 refused", myhost.c_str()); - Utils->DoFailOver(myautoconnect); + Utils->Creator->ConnectServer(myautoconnect); break; case I_ERR_SOCKET: ServerInstance->SNO->WriteToSnoMask('l', "Connection failed: Could not create socket (%s)", strerror(errno)); -- cgit v1.3.1-10-gc9f91