aboutsummaryrefslogtreecommitdiff
path: root/X11/xtrans/Xtranssock.c
diff options
context:
space:
mode:
Diffstat (limited to 'X11/xtrans/Xtranssock.c')
-rw-r--r--X11/xtrans/Xtranssock.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/X11/xtrans/Xtranssock.c b/X11/xtrans/Xtranssock.c
index fdf1dd774..6cde146cd 100644
--- a/X11/xtrans/Xtranssock.c
+++ b/X11/xtrans/Xtranssock.c
@@ -445,6 +445,27 @@ TRANS(SocketOpen) (int i, int type)
}
#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;
}