mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Don't try quite so hard to writev() the entire buffer in one go
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12583 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
5af0e15f15
commit
ac83d3b0d6
@ -216,6 +216,9 @@ void StreamSocket::DoRead()
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
|
||||
void StreamSocket::DoWrite()
|
||||
{
|
||||
if (sendq.empty())
|
||||
@ -331,10 +334,10 @@ void StreamSocket::DoWrite()
|
||||
// Prepare a writev() call to write all buffers efficiently
|
||||
int bufcount = sendq.size();
|
||||
|
||||
// cap the number of buffers at IOV_MAX
|
||||
if (bufcount > IOV_MAX)
|
||||
// cap the number of buffers at MYIOV_MAX
|
||||
if (bufcount > MYIOV_MAX)
|
||||
{
|
||||
bufcount = IOV_MAX;
|
||||
bufcount = MYIOV_MAX;
|
||||
}
|
||||
|
||||
int rv_max = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user