summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-26 14:12:45 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-26 14:12:45 +0000
commit2d04042f178d17e377cf5c286d927f3efc731f3f (patch)
treea066629cf900d93781c5fd03502e7443b73ae496
parentb1cbabb6da0779606e24498f8058cbc199c48d23 (diff)
Regressed buffering code
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3759 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/socket.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 787e656da..20a447ba7 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -257,15 +257,15 @@ int InspSocket::Write(const std::string &data)
if (this->ClosePending)
return false;
- int result = write(this->fd,data.c_str(),data.length());
+ /*int result = write(this->fd,data.c_str(),data.length());
if (result < 1)
return false;
- return true;
+ return true;*/
/* Try and append the data to the back of the queue, and send it on its way
*/
- //outbuffer.push_back(data);
- //return (!this->FlushWriteBuffer());
+ outbuffer.push_back(data);
+ return (!this->FlushWriteBuffer());
}
bool InspSocket::FlushWriteBuffer()
@@ -273,7 +273,7 @@ bool InspSocket::FlushWriteBuffer()
if (this->ClosePending)
return true;
- /*if ((this->fd > -1) && (this->state == I_CONNECTED))
+ if ((this->fd > -1) && (this->state == I_CONNECTED))
{
if (outbuffer.size())
{
@@ -284,9 +284,9 @@ bool InspSocket::FlushWriteBuffer()
log(DEBUG,"Wrote %d to socket",result);
if ((unsigned int)result == outbuffer[0].length())
{
- * The whole block was written (usually a line)
+ /* The whole block was written (usually a line)
* Pop the block off the front of the queue
- *
+ */
log(DEBUG,"Popping front item, now %d items left",outbuffer.size());
outbuffer.pop_front();
}
@@ -306,7 +306,7 @@ bool InspSocket::FlushWriteBuffer()
return true;
}
}
- }*/
+ }
return false;
}