From 73f57be5003c6c36d74c90a14156e2f88946ee6c Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Fri, 7 Dec 2001 17:28:34 +0000 Subject: - stevesk@cvs.openbsd.org 2001/12/06 18:20:32 [channels.c] disable nagle for X11 fake server and client TCPs. from netbsd. ok markus@ --- ChangeLog | 6 +++++- channels.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d79457079..189b0dbcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,10 @@ - stevesk@cvs.openbsd.org 2001/12/06 18:09:23 [channels.c session.c] strncpy->strlcpy. remaining strncpy's are necessary. ok markus@ + - stevesk@cvs.openbsd.org 2001/12/06 18:20:32 + [channels.c] + disable nagle for X11 fake server and client TCPs. from netbsd. + ok markus@ 20011206 - (bal) OpenBSD CVS Sync @@ -7005,4 +7009,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1690 2001/12/07 17:26:48 mouring Exp $ +$Id: ChangeLog,v 1.1691 2001/12/07 17:28:34 mouring Exp $ diff --git a/channels.c b/channels.c index 3fe619f48..694b7cc78 100644 --- a/channels.c +++ b/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.145 2001/12/06 18:09:23 stevesk Exp $"); +RCSID("$OpenBSD: channels.c,v 1.146 2001/12/06 18:20:32 stevesk Exp $"); #include "ssh.h" #include "ssh1.h" @@ -993,7 +993,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset) { Channel *nc; struct sockaddr addr; - int newsock; + int newsock, on = 1; socklen_t addrlen; char buf[16384], *remote_ipaddr; int remote_port; @@ -1006,6 +1006,10 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset) error("accept: %.100s", strerror(errno)); return; } + if (setsockopt(newsock, IPPROTO_TCP, TCP_NODELAY, &on, + sizeof on) == -1) + error("setsockopt TCP_NODELAY: %.100s", + strerror(errno)); remote_ipaddr = get_peer_ipaddr(newsock); remote_port = get_peer_port(newsock); snprintf(buf, sizeof buf, "X11 connection from %.200s port %d", @@ -2567,7 +2571,7 @@ connect_local_xsocket(u_int dnr) int x11_connect_display(void) { - int display_number, sock = 0; + int display_number, sock = 0, on = 1; const char *display; char buf[1024], *cp; struct addrinfo hints, *ai, *aitop; @@ -2655,6 +2659,8 @@ x11_connect_display(void) strerror(errno)); return -1; } + if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on) == -1) + error("setsockopt TCP_NODELAY: %.100s", strerror(errno)); return sock; } -- cgit v1.2.3