summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2014-04-08 21:02:40 +0200
committerMatthieu Herrb <matthieu@herrb.eu>2014-04-08 21:02:40 +0200
commit1ffd8084171253adadf649364c96e9b115c77cf9 (patch)
tree8f2d33ca48f0f73aca922187f410268a5e81daa7
parent69579512bc9f7a4b1d4c52999a73b59a4e37300c (diff)
parenta57a7f62242e1ea972b81414741729bf3dbae0a4 (diff)
Merge remote-tracking branch 'origin/master' into obsd
-rw-r--r--Xtrans.c7
-rw-r--r--Xtranssock.c21
-rw-r--r--configure.ac2
-rw-r--r--xtrans.pc.in2
4 files changed, 27 insertions, 5 deletions
diff --git a/Xtrans.c b/Xtrans.c
index 4199c52..27973ef 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -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@