diff options
-rw-r--r-- | Xtrans.c | 7 | ||||
-rw-r--r-- | Xtranssock.c | 21 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | xtrans.pc.in | 2 |
4 files changed, 27 insertions, 5 deletions
@@ -48,8 +48,9 @@ from The Open Group. */ #include <ctype.h> -#ifdef HAVE_SYSTEMD_DAEMON +#include <stdlib.h> #include <string.h> +#ifdef HAVE_SYSTEMD_DAEMON #include <systemd/sd-daemon.h> #endif @@ -166,8 +167,8 @@ TRANS(SelectTransport) (const char *protocol) protobuf[PROTOBUFSIZE-1] = '\0'; for (i = 0; i < PROTOBUFSIZE && protobuf[i] != '\0'; i++) - if (isupper (protobuf[i])) - protobuf[i] = tolower (protobuf[i]); + if (isupper ((unsigned char)protobuf[i])) + protobuf[i] = tolower ((unsigned char)protobuf[i]); /* Look at all of the configured protocols */ diff --git a/Xtranssock.c b/Xtranssock.c index b729c31..f122dc8 100644 --- a/Xtranssock.c +++ b/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; } diff --git a/configure.ac b/configure.ac index 6898c6d..bb8a34c 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([xtrans], [1.3.3], +AC_INIT([xtrans], [1.3.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xtrans]) AC_CONFIG_SRCDIR([Makefile.am]) diff --git a/xtrans.pc.in b/xtrans.pc.in index 90d19b1..b8d135b 100644 --- a/xtrans.pc.in +++ b/xtrans.pc.in @@ -6,4 +6,4 @@ includedir=@includedir@ Name: XTrans Description: Abstract network code for X Version: @PACKAGE_VERSION@ -Cflags: -I${includedir} -D_BSD_SOURCE @fchown_define@ @sticky_bit_define@ +Cflags: -I${includedir} -D_DEFAULT_SOURCE -D_BSD_SOURCE @fchown_define@ @sticky_bit_define@ |