summaryrefslogtreecommitdiff
path: root/src/servers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/servers.cpp')
-rw-r--r--src/servers.cpp10
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();