summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--channels.c14
-rw-r--r--misc.c15
-rw-r--r--misc.h3
-rw-r--r--packet.c7
5 files changed, 31 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 225fd09c9..b31369607 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
120020205
2 - (djm) OpenBSD CVS Sync
3 - stevesk@cvs.openbsd.org 2002/01/24 21:09:25
4 [channels.c misc.c misc.h packet.c]
5 add set_nodelay() to set TCP_NODELAY on a socket (prep for nagle tuning).
6 no nagle changes just yet; ok djm@ markus@
7
8
120020130 920020130
2 - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@ 10 - (djm) Delay PRNG seeding until we need it in ssh-keygen, from markus@
3 - (tim) [configure.ac] fix logic on when ssh-rand-helper is installed. 11 - (tim) [configure.ac] fix logic on when ssh-rand-helper is installed.
@@ -7399,4 +7407,4 @@
7399 - Wrote replacements for strlcpy and mkdtemp 7407 - Wrote replacements for strlcpy and mkdtemp
7400 - Released 1.0pre1 7408 - Released 1.0pre1
7401 7409
7402$Id: ChangeLog,v 1.1798 2002/01/31 06:14:03 tim Exp $ 7410$Id: ChangeLog,v 1.1799 2002/02/05 00:52:13 djm Exp $
diff --git a/channels.c b/channels.c
index 73bc10a1a..2436e0873 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.161 2002/01/21 23:27:10 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.162 2002/01/24 21:09:25 stevesk Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -986,7 +986,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
986{ 986{
987 Channel *nc; 987 Channel *nc;
988 struct sockaddr addr; 988 struct sockaddr addr;
989 int newsock, on = 1; 989 int newsock;
990 socklen_t addrlen; 990 socklen_t addrlen;
991 char buf[16384], *remote_ipaddr; 991 char buf[16384], *remote_ipaddr;
992 int remote_port; 992 int remote_port;
@@ -1004,10 +1004,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
1004 error("accept: %.100s", strerror(errno)); 1004 error("accept: %.100s", strerror(errno));
1005 return; 1005 return;
1006 } 1006 }
1007 if (setsockopt(newsock, IPPROTO_TCP, TCP_NODELAY, &on, 1007 set_nodelay(newsock);
1008 sizeof on) == -1)
1009 error("setsockopt TCP_NODELAY: %.100s",
1010 strerror(errno));
1011 remote_ipaddr = get_peer_ipaddr(newsock); 1008 remote_ipaddr = get_peer_ipaddr(newsock);
1012 remote_port = get_peer_port(newsock); 1009 remote_port = get_peer_port(newsock);
1013 snprintf(buf, sizeof buf, "X11 connection from %.200s port %d", 1010 snprintf(buf, sizeof buf, "X11 connection from %.200s port %d",
@@ -2495,7 +2492,7 @@ connect_local_xsocket(u_int dnr)
2495int 2492int
2496x11_connect_display(void) 2493x11_connect_display(void)
2497{ 2494{
2498 int display_number, sock = 0, on = 1; 2495 int display_number, sock = 0;
2499 const char *display; 2496 const char *display;
2500 char buf[1024], *cp; 2497 char buf[1024], *cp;
2501 struct addrinfo hints, *ai, *aitop; 2498 struct addrinfo hints, *ai, *aitop;
@@ -2583,8 +2580,7 @@ x11_connect_display(void)
2583 strerror(errno)); 2580 strerror(errno));
2584 return -1; 2581 return -1;
2585 } 2582 }
2586 if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on) == -1) 2583 set_nodelay(sock);
2587 error("setsockopt TCP_NODELAY: %.100s", strerror(errno));
2588 return sock; 2584 return sock;
2589} 2585}
2590 2586
diff --git a/misc.c b/misc.c
index 04ea7a79b..fbdf408e8 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.14 2001/12/19 07:18:56 deraadt Exp $ */ 1/* $OpenBSD: misc.c,v 1.15 2002/01/24 21:09:25 stevesk Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: misc.c,v 1.14 2001/12/19 07:18:56 deraadt Exp $"); 28RCSID("$OpenBSD: misc.c,v 1.15 2002/01/24 21:09:25 stevesk Exp $");
29 29
30#include "misc.h" 30#include "misc.h"
31#include "log.h" 31#include "log.h"
@@ -92,6 +92,17 @@ unset_nonblock(int fd)
92 fd, strerror(errno)); 92 fd, strerror(errno));
93} 93}
94 94
95/* disable nagle on socket */
96void
97set_nodelay(int fd)
98{
99 int on = 1;
100
101 debug("fd %d setting TCP_NODELAY", fd);
102 if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on) == -1)
103 error("setsockopt TCP_NODELAY: %.100s", strerror(errno));
104}
105
95/* Characters considered whitespace in strsep calls. */ 106/* Characters considered whitespace in strsep calls. */
96#define WHITESPACE " \t\r\n" 107#define WHITESPACE " \t\r\n"
97 108
diff --git a/misc.h b/misc.h
index fc5645271..668fd60d3 100644
--- a/misc.h
+++ b/misc.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.h,v 1.10 2001/06/26 17:27:24 markus Exp $ */ 1/* $OpenBSD: misc.h,v 1.11 2002/01/24 21:09:25 stevesk Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,6 +16,7 @@ char *chop(char *);
16char *strdelim(char **); 16char *strdelim(char **);
17void set_nonblock(int); 17void set_nonblock(int);
18void unset_nonblock(int); 18void unset_nonblock(int);
19void set_nodelay(int);
19int a2port(const char *); 20int a2port(const char *);
20char *cleanhostname(char *); 21char *cleanhostname(char *);
21char *colon(char *); 22char *colon(char *);
diff --git a/packet.c b/packet.c
index 960675a93..3a498f631 100644
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: packet.c,v 1.85 2002/01/18 18:14:17 stevesk Exp $"); 40RCSID("$OpenBSD: packet.c,v 1.86 2002/01/24 21:09:25 stevesk Exp $");
41 41
42#include "xmalloc.h" 42#include "xmalloc.h"
43#include "buffer.h" 43#include "buffer.h"
@@ -1191,7 +1191,6 @@ packet_set_interactive(int interactive)
1191 int lowdelay = IPTOS_LOWDELAY; 1191 int lowdelay = IPTOS_LOWDELAY;
1192 int throughput = IPTOS_THROUGHPUT; 1192 int throughput = IPTOS_THROUGHPUT;
1193#endif 1193#endif
1194 int on = 1;
1195 1194
1196 if (called) 1195 if (called)
1197 return; 1196 return;
@@ -1219,9 +1218,7 @@ packet_set_interactive(int interactive)
1219 strerror(errno)); 1218 strerror(errno));
1220 } 1219 }
1221#endif 1220#endif
1222 if (setsockopt(connection_in, IPPROTO_TCP, TCP_NODELAY, (void *) &on, 1221 set_nodelay(connection_in);
1223 sizeof(on)) < 0)
1224 error("setsockopt TCP_NODELAY: %.100s", strerror(errno));
1225 } else if (packet_connection_is_ipv4()) { 1222 } else if (packet_connection_is_ipv4()) {
1226 /* 1223 /*
1227 * Set IP options for a non-interactive connection. Use 1224 * Set IP options for a non-interactive connection. Use