diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-24 01:49:07 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-24 01:49:07 +0000 |
commit | 5b08c0883c83c95ceca07e590620fe254b17f6ab (patch) | |
tree | 7ea4f795eb8a18530e231dc5ce2bac41027c3eb4 /src/servers.cpp | |
parent | 0a1ef900f98881a03dfa0945ff1eddfa8b1dfba5 (diff) |
Added ping checks for server links (experimental)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1481 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/servers.cpp')
-rw-r--r-- | src/servers.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/servers.cpp b/src/servers.cpp index 15929345f..38f9cfb5f 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -250,6 +250,15 @@ void serverrec::FlushWriteBuffers() { for (int i = 0; i < this->connectors.size(); i++) { + if (this->connectors[i].GetState() != STATE_DISCONNECTED) + { + 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 (this->connectors[i].HasBufferedOutput()) { if (!this->connectors[i].FlushWriteBuf()) @@ -400,6 +409,7 @@ bool serverrec::RecvPacket(std::deque<std::string> &messages, char* recvhost,std } if (this->connectors[i].BufferIsComplete()) { + this->connectors[i].ResetPing(); while (this->connectors[i].BufferIsComplete()) { std::string text = this->connectors[i].GetBuffer(); |