From 0dbcc361f24e1106cf233afd0f46c99f8f2d4d0c Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 16 Apr 2004 13:12:32 +0000 Subject: Added ability to update routing table on the fly if a connection is lost git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@612 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/connection.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/connection.cpp') diff --git a/src/connection.cpp b/src/connection.cpp index 52ec677c0..a4818cad7 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -182,6 +182,7 @@ bool connection::BeginLink(char* targethost, int port, char* password, char* ser } else { + connector.SetState(STATE_DISCONNECTED); WriteOpers("Could not create outbound connection to %s:%d",targethost,port); } } @@ -212,6 +213,7 @@ bool connection::MeshCookie(char* targethost, int port, long cookie, char* serve } else { + connector.SetState(STATE_DISCONNECTED); WriteOpers("Could not create outbound connection to %s:%d",targethost,port); } } @@ -298,6 +300,10 @@ int ircd_connector::GetState() void ircd_connector::SetState(int state) { this->state = state; + if (state == STATE_DISCONNECTED) + { + NetSendMyRoutingTable(); + } } void ircd_connector::CloseConnection() @@ -317,7 +323,10 @@ void ircd_connector::SetDescriptor(int fd) bool connection::SendPacket(char *message, const char* host) { ircd_connector* cn = this->FindHost(host); - strncat(message,"\n",MAXBUF); + if (!strchr(message,'\n')) + { + strncat(message,"\n",MAXBUF); + } if (cn) { -- cgit v1.3.1-10-gc9f91