summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-02-26 18:12:51 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-02-26 18:12:51 +0000
commit1ebd7a5342a91f8aaa3eabd6c86c7afe8d663cd6 (patch)
tree661c0e5ccf8ce7a9b599430d3e160eaa937916ee
parent90fd814f90a5733584d8c2d877924469ac39d819 (diff)
- stevesk@cvs.openbsd.org 2002/02/24 19:59:42
[channels.c misc.c] disable Nagle in connect_to() and channel_post_port_listener() (port forwarding endpoints). the intention is to preserve the on-the-wire appearance to applications at either end; the applications can then enable TCP_NODELAY according to their requirements. ok markus@
-rw-r--r--ChangeLog8
-rw-r--r--channels.c4
-rw-r--r--misc.c18
3 files changed, 24 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 784ddeb8f..8e1b4677d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,12 @@
42 [auth2.c authfd.c authfd.h authfile.c kexdh.c kexgex.c key.c key.h 42 [auth2.c authfd.c authfd.h authfile.c kexdh.c kexgex.c key.c key.h
43 ssh-dss.c ssh-dss.h ssh-keygen.c ssh-rsa.c ssh-rsa.h sshconnect2.c] 43 ssh-dss.c ssh-dss.h ssh-keygen.c ssh-rsa.c ssh-rsa.h sshconnect2.c]
44 signed vs. unsigned: make size arguments u_int, ok stevesk@ 44 signed vs. unsigned: make size arguments u_int, ok stevesk@
45 - stevesk@cvs.openbsd.org 2002/02/24 19:59:42
46 [channels.c misc.c]
47 disable Nagle in connect_to() and channel_post_port_listener() (port
48 forwarding endpoints). the intention is to preserve the on-the-wire
49 appearance to applications at either end; the applications can then
50 enable TCP_NODELAY according to their requirements. ok markus@
45 51
4620020225 5220020225
47 - (bal) Last AIX patch. Moved aix_usrinfo() outside of do_setuserconext() 53 - (bal) Last AIX patch. Moved aix_usrinfo() outside of do_setuserconext()
@@ -7715,4 +7721,4 @@
7715 - Wrote replacements for strlcpy and mkdtemp 7721 - Wrote replacements for strlcpy and mkdtemp
7716 - Released 1.0pre1 7722 - Released 1.0pre1
7717 7723
7718$Id: ChangeLog,v 1.1885 2002/02/26 18:09:42 mouring Exp $ 7724$Id: ChangeLog,v 1.1886 2002/02/26 18:12:51 mouring Exp $
diff --git a/channels.c b/channels.c
index 50d6f16ad..325f278f0 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.168 2002/02/14 23:27:59 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.169 2002/02/24 19:59:42 stevesk Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -1116,6 +1116,7 @@ channel_post_port_listener(Channel *c, fd_set * readset, fd_set * writeset)
1116 error("accept: %.100s", strerror(errno)); 1116 error("accept: %.100s", strerror(errno));
1117 return; 1117 return;
1118 } 1118 }
1119 set_nodelay(newsock);
1119 nc = channel_new(rtype, 1120 nc = channel_new(rtype,
1120 nextstate, newsock, newsock, -1, 1121 nextstate, newsock, newsock, -1,
1121 c->local_window_max, c->local_maxpacket, 1122 c->local_window_max, c->local_maxpacket,
@@ -2270,6 +2271,7 @@ connect_to(const char *host, u_short port)
2270 return -1; 2271 return -1;
2271 } 2272 }
2272 /* success */ 2273 /* success */
2274 set_nodelay(sock);
2273 return sock; 2275 return sock;
2274} 2276}
2275 2277
diff --git a/misc.c b/misc.c
index fbdf408e8..d34423f64 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.15 2002/01/24 21:09:25 stevesk Exp $ */ 1/* $OpenBSD: misc.c,v 1.16 2002/02/24 19:59:42 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.15 2002/01/24 21:09:25 stevesk Exp $"); 28RCSID("$OpenBSD: misc.c,v 1.16 2002/02/24 19:59:42 stevesk Exp $");
29 29
30#include "misc.h" 30#include "misc.h"
31#include "log.h" 31#include "log.h"
@@ -96,10 +96,20 @@ unset_nonblock(int fd)
96void 96void
97set_nodelay(int fd) 97set_nodelay(int fd)
98{ 98{
99 int on = 1; 99 int opt, optlen;
100 100
101 optlen = sizeof opt;
102 if (getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen) == -1) {
103 error("getsockopt TCP_NODELAY: %.100s", strerror(errno));
104 return;
105 }
106 if (opt == 1) {
107 debug2("fd %d is TCP_NODELAY", fd);
108 return;
109 }
110 opt = 1;
101 debug("fd %d setting TCP_NODELAY", fd); 111 debug("fd %d setting TCP_NODELAY", fd);
102 if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on) == -1) 112 if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof opt) == -1)
103 error("setsockopt TCP_NODELAY: %.100s", strerror(errno)); 113 error("setsockopt TCP_NODELAY: %.100s", strerror(errno));
104} 114}
105 115