1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 19:26:40 +02:00

Handle not being able to completely flush our write buffer correctly

This commit is contained in:
Adam
2010-12-24 20:02:25 -05:00
parent 667419a460
commit 479fc1ce3f
+6 -8
View File
@@ -435,16 +435,14 @@ bool BufferedSocket::ProcessRead()
*/
bool BufferedSocket::ProcessWrite()
{
if (WriteBuffer.empty())
{
if (this->WriteBuffer.empty())
return true;
}
if (this->IO->Send(this, WriteBuffer) == -1)
{
int count = this->IO->Send(this, this->WriteBuffer);
if (count == -1)
return false;
}
WriteBuffer.clear();
SocketEngine->ClearWritable(this);
this->WriteBuffer = this->WriteBuffer.substr(count);
if (this->WriteBuffer.empty())
SocketEngine->ClearWritable(this);
return true;
}