- libxcb-1.2-no-nagle.patch: Disable Nagle's algorithm on TCP. (#442158)

This commit is contained in:
Adam Jackson 2009-06-24 16:07:48 +00:00
parent 0536de84ab
commit 75deaf2ed6
2 changed files with 36 additions and 1 deletions

30
libxcb-1.2-no-nagle.patch Normal file
View File

@ -0,0 +1,30 @@
commit ee89850e68205a7f8961ace0839b5be86040dade
Author: elupus <elupus@ecce.se>
Date: Tue May 26 16:14:48 2009 +0200
Disable Nagle on TCP socket
Signed-off-by: Julien Danjou <julien@danjou.info>
diff --git a/src/xcb_util.c b/src/xcb_util.c
index adac909..55aadb7 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -30,6 +30,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#ifdef DNETCONN
#include <netdnet/dnetdb.h>
#include <netdnet/dn.h>
@@ -257,6 +258,9 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port)
{
fd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
if(fd >= 0) {
+ int on = 1;
+ setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+
if (connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0)
break;
close(fd);

View File

@ -4,7 +4,7 @@
Name: libxcb
Version: 1.2
Release: 4%{?dist}
Release: 5%{?dist}
Summary: A C binding to the X11 protocol
Group: System Environment/Libraries
@ -21,6 +21,7 @@ Source2: http://xcb.freedesktop.org/dist/xpyb-%{xpyb_version}.tar.bz2
Patch0: libxcb-1.1-no-pthread-stubs.patch
Patch1: libxcb-1.2-to-git-6e2e87d.patch
Patch2: libxcb-1.2-no-nagle.patch
BuildRequires: autoconf automake libtool pkgconfig
BuildRequires: doxygen
@ -67,6 +68,7 @@ Python bindings for %{name}.
%setup -q -b2
%patch0 -p1 -b .pthread-stubs
%patch1 -p1 -b .git
%patch2 -p1 -b .no-nagle
%build
autoreconf -v --install
@ -116,6 +118,9 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitearch}/xcb
%changelog
* Wed Jun 24 2009 Adam Jackson <ajax@redhat.com> 1.2-5
- libxcb-1.2-no-nagle.patch: Disable Nagle's algorithm on TCP. (#442158)
* Tue May 19 2009 Adam Jackson <ajax@redhat.com> 1.2-4
- Add libxcb-python subpackage