git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1500
e03df62e-2008-0410-955e-
edbf42e46eb7
{
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;
}