summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-07 16:56:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-07 16:56:40 +0000
commit74e622fbfa004b3c3363fc7bc83ae322c4eb3c5c (patch)
tree29fea147778fa7c858d6f26a9df2644f2c59f7e3
parent2f7aa87379465b65f545bf7809600b5241b028b6 (diff)
Delete the file descriptor upon write error to an inspsocket, preventing it eating cpu with endless read events
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5154 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspsocket.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index d1dc1ce6b..fb9238a97 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -356,6 +356,8 @@ bool InspSocket::FlushWriteBuffer()
this->Instance->Log(DEBUG,"Write error on socket: %s",strerror(errno));
this->OnError(I_ERR_WRITE);
this->state = I_ERROR;
+ ServerInstance->SE->DelFd(this->sock);
+ this->sock->Close();
return true;
}
}