diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-16 13:12:32 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-16 13:12:32 +0000 |
commit | 0dbcc361f24e1106cf233afd0f46c99f8f2d4d0c (patch) | |
tree | 96ae3d8e85eca54b09064245230a5aaceaf0c12c /src/connection.cpp | |
parent | fcc46b271ae45263cb2f7879b9f580655855363c (diff) |
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
Diffstat (limited to 'src/connection.cpp')
-rw-r--r-- | src/connection.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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) { |