diff options
Diffstat (limited to 'src/sockets.cpp')
-rw-r--r-- | src/sockets.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sockets.cpp b/src/sockets.cpp index 0eb7733cf..e980056f5 100644 --- a/src/sockets.cpp +++ b/src/sockets.cpp @@ -509,15 +509,12 @@ 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(); + this->WriteBuffer = this->WriteBuffer.substr(count); SocketEngine->ClearWritable(this); return true; |