git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3355
e03df62e-2008-0410-955e-
edbf42e46eb7
void InspSocket::FlushWriteBuffer()
{
int result = 0;
void InspSocket::FlushWriteBuffer()
{
int result = 0;
- if (this->Buffer.length())
+ const char* n = this->Buffer.c_str();
+ int v = this->Buffer.length();
+ if (v > 0)
- result = send(this->fd,this->Buffer.c_str(),this->Buffer.length(),0);
+ result = send(this->fd,n,v,0);
- if (result == (int)this->Buffer.length())
{
this->Buffer = "";
}
else
{
/* If we wrote some, advance the buffer forwards */
{
this->Buffer = "";
}
else
{
/* If we wrote some, advance the buffer forwards */
- char* n = (char*)this->Buffer.c_str();
n += result;
this->Buffer = n;
}
n += result;
this->Buffer = n;
}