From 2f350cc665025a5b6b5fa52242be9c3b623567f9 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 2 Jun 2005 21:10:29 +0000 Subject: More fixes for Vincent bug git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1592 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/connection.cpp | 2 -- src/servers.cpp | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/connection.cpp b/src/connection.cpp index b9a613cea..14c108fd5 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -394,8 +394,6 @@ void ircd_connector::CloseConnection() { log(DEBUG,"Closing connection"); // flush the queues - this->sendq = ""; - this->ircdbuffer = ""; shutdown(this->fd,2); close(this->fd); } diff --git a/src/servers.cpp b/src/servers.cpp index f7bbe44a7..b66546f42 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -300,7 +300,6 @@ void serverrec::FlushWriteBuffers() if (!this->connectors[i].CheckPing()) { WriteOpers("*** Lost single connection to %s: Ping timeout",this->connectors[i].GetServerName().c_str()); - this->connectors[i].CloseConnection(); this->connectors[i].SetState(STATE_DISCONNECTED); if (!IsRoutable(this->connectors[i].GetServerName())) { @@ -309,6 +308,7 @@ void serverrec::FlushWriteBuffers() NetSendToAllExcept(this->connectors[i].GetServerName().c_str(),buffer); DoSplit(this->connectors[i].GetServerName().c_str()); } + this->connectors[i].CloseConnection(); has_been_netsplit = true; } } @@ -316,7 +316,6 @@ void serverrec::FlushWriteBuffers() { // if we're here the write() caused an error, we cannot proceed WriteOpers("*** Lost single connection to %s, link inactive and retrying: %s",this->connectors[i].GetServerName().c_str(),this->connectors[i].GetWriteError().c_str()); - this->connectors[i].CloseConnection(); this->connectors[i].SetState(STATE_DISCONNECTED); if (!IsRoutable(this->connectors[i].GetServerName())) { @@ -325,6 +324,7 @@ void serverrec::FlushWriteBuffers() NetSendToAllExcept(this->connectors[i].GetServerName().c_str(),buffer); DoSplit(this->connectors[i].GetServerName().c_str()); } + this->connectors[i].CloseConnection(); has_been_netsplit = true; } if ((this->connectors[i].HasBufferedOutput()) && (this->connectors[i].GetState() != STATE_DISCONNECTED)) @@ -333,7 +333,6 @@ void serverrec::FlushWriteBuffers() { // if we're here the write() caused an error, we cannot proceed WriteOpers("*** Lost single connection to %s, link inactive and retrying: %s",this->connectors[i].GetServerName().c_str(),this->connectors[i].GetWriteError().c_str()); - this->connectors[i].CloseConnection(); this->connectors[i].SetState(STATE_DISCONNECTED); if (!IsRoutable(this->connectors[i].GetServerName())) { @@ -342,6 +341,7 @@ void serverrec::FlushWriteBuffers() NetSendToAllExcept(this->connectors[i].GetServerName().c_str(),buffer); DoSplit(this->connectors[i].GetServerName().c_str()); } + this->connectors[i].CloseConnection(); has_been_netsplit = true; } } @@ -477,7 +477,6 @@ bool serverrec::RecvPacket(std::deque &messages, char* recvhost,std { log(DEBUG,"recv() failed for serverrec::RecvPacket(): EOF"); log(DEBUG,"Disabling connector: %s",this->connectors[i].GetServerName().c_str()); - this->connectors[i].CloseConnection(); this->connectors[i].SetState(STATE_DISCONNECTED); if (!IsRoutable(this->connectors[i].GetServerName())) { @@ -486,6 +485,7 @@ bool serverrec::RecvPacket(std::deque &messages, char* recvhost,std NetSendToAllExcept(this->connectors[i].GetServerName().c_str(),buffer); DoSplit(this->connectors[i].GetServerName().c_str()); } + this->connectors[i].CloseConnection(); has_been_netsplit = true; break; } @@ -495,7 +495,6 @@ bool serverrec::RecvPacket(std::deque &messages, char* recvhost,std { log(DEBUG,"recv() failed for serverrec::RecvPacket(): %s",strerror(errno)); log(DEBUG,"Disabling connector: %s",this->connectors[i].GetServerName().c_str()); - this->connectors[i].CloseConnection(); this->connectors[i].SetState(STATE_DISCONNECTED); if (!IsRoutable(this->connectors[i].GetServerName())) { @@ -505,6 +504,7 @@ bool serverrec::RecvPacket(std::deque &messages, char* recvhost,std DoSplit(this->connectors[i].GetServerName().c_str()); } has_been_netsplit = true; + this->connectors[i].CloseConnection(); break; } } @@ -514,7 +514,6 @@ bool serverrec::RecvPacket(std::deque &messages, char* recvhost,std if (!this->connectors[i].AddBuffer(data)) { WriteOpers("*** Read buffer for %s exceeds maximum, closing connection!",this->connectors[i].GetServerName().c_str()); - this->connectors[i].CloseConnection(); this->connectors[i].SetState(STATE_DISCONNECTED); if (!IsRoutable(this->connectors[i].GetServerName())) { @@ -524,6 +523,7 @@ bool serverrec::RecvPacket(std::deque &messages, char* recvhost,std DoSplit(this->connectors[i].GetServerName().c_str()); } has_been_netsplit = true; + this->connectors[i].CloseConnection(); break; } if (this->connectors[i].BufferIsComplete()) -- cgit v1.2.3