summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/connection.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index 30a961e96..ce5ff3f9f 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -235,19 +235,22 @@ bool ircd_connector::FlushWriteBuf()
{
char* tb = (char*)this->sendq.c_str();
int n_sent = write(this->fd,tb,this->sendq.length());
- if (n_sent == -1)
- {
- this->SetWriteError(strerror(errno));
- return false;
- }
- else
- {
- log(DEBUG,"Wrote %d chars to socket",n_sent);
- // advance the queue
- tb += n_sent;
- this->sendq = tb;
- return true;
- }
+ if (n_sent != 0)
+ {
+ if (n_sent == -1)
+ {
+ this->SetWriteError(strerror(errno));
+ return false;
+ }
+ else
+ {
+ log(DEBUG,"Wrote %d chars to socket",n_sent);
+ // advance the queue
+ tb += n_sent;
+ this->sendq = tb;
+ return true;
+ }
+ }
}
return true;
}