From faa13181f742e2dd4e14ad5171e141806218e1e0 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 2 Jun 2005 14:16:40 +0000 Subject: Attempt to fix recursive loop git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1590 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/servers.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/servers.cpp b/src/servers.cpp index 5448d01da..2675849a5 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -380,10 +380,18 @@ bool serverrec::SendPacket(char *message, const char* sendhost) if (!strcasecmp(this->connectors[k].routes[m].c_str(),sendhost)) { log(DEBUG,"Found alternative route for packet: %s",this->connectors[k].GetServerName().c_str()); - char buffer[MAXBUF]; - snprintf(buffer,MAXBUF,"R %s %s",sendhost,message); - this->SendPacket(buffer,this->connectors[k].GetServerName().c_str()); - return true; + if (this->connectors[k].GetState() != STATE_DISCONNECTED) + { + char buffer[MAXBUF]; + snprintf(buffer,MAXBUF,"R %s %s",sendhost,message); + this->SendPacket(buffer,this->connectors[k].GetServerName().c_str()); + return true; + } + else + { + log(DEBUG,"Nope, this route is down..."); + return false; + } } } } -- cgit v1.2.3