Increase the send buffer for UNIX sockets to be at least 64k such that large

sends (for example, XGetImage() replies in the X server) happen at non-glacial
speeds.  Makes Firefox useable again on web pages with large images.  Already
pushed upstream.

ok matthieu@
This commit is contained in:
kettenis 2014-03-31 12:09:00 +00:00
parent 1d6e900744
commit de0199f63b

View File

@ -445,6 +445,27 @@ TRANS(SocketOpen) (int i, int type)
} }
#endif #endif
/*
* Some systems provide a really small default buffer size for
* UNIX sockets. Bump it up a bit such that large transfers don't
* proceed at glacial speed.
*/
#ifdef SO_SNDBUF
if (Sockettrans2devtab[i].family == AF_UNIX)
{
SOCKLEN_T len = sizeof (int);
int val;
if (getsockopt (ciptr->fd, SOL_SOCKET, SO_SNDBUF,
(char *) &val, &len) == 0 && val < 64 * 1024)
{
val = 64 * 1024;
setsockopt (ciptr->fd, SOL_SOCKET, SO_SNDBUF,
(char *) &val, sizeof (int));
}
}
#endif
return ciptr; return ciptr;
} }