-/*
- * This function formerly tried to flush write buffer each call.
- * While admirable in attempting to get the data out to wherever
- * it is going, on a full socket, it's just going to syscall write() and
- * EAGAIN constantly, instead of waiting in the SE to know if it can write
- * which will chew a bit of CPU.
- *
- * So, now this function returns void (take note) and just adds to the sendq.
- *
- * It'll get written at a determinate point when the socketengine tells us it can write.
- * -- w00t (april 1, 2008)
- */
-void BufferedSocket::Write(const std::string &data)
-{
- /* Append the data to the back of the queue ready for writing */
- outbuffer.push_back(data);
-
- /* Mark ourselves as wanting write */
- this->ServerInstance->SE->WantWrite(this);
-}
+/* Don't try to prepare huge blobs of data to send to a blocked socket */
+static const int MYIOV_MAX = IOV_MAX < 128 ? IOV_MAX : 128;