summaryrefslogtreecommitdiff
path: root/src/sockets.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-12-10 01:18:59 -0500
committerAdam <Adam@anope.org>2010-12-12 19:37:03 -0500
commitad5da2a98867da93328b3caaced1eb470ab14dd0 (patch)
tree1812640e20cc538ac89d7a6e57ac890ccf09da1b /src/sockets.cpp
parent6ab7cf968938fc070ee01f314834ad1e66d1de09 (diff)
Handle not being able to completely flush our write buffer correctly
Diffstat (limited to 'src/sockets.cpp')
-rw-r--r--src/sockets.cpp11
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;