diff options
Diffstat (limited to 'usr.bin/ssh/misc.c')
-rw-r--r-- | usr.bin/ssh/misc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.bin/ssh/misc.c b/usr.bin/ssh/misc.c index 9fffc10a6f3..a5447b4dacd 100644 --- a/usr.bin/ssh/misc.c +++ b/usr.bin/ssh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.14 2001/12/19 07:18:56 deraadt Exp $ */ +/* $OpenBSD: misc.c,v 1.15 2002/01/24 21:09:25 stevesk Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: misc.c,v 1.14 2001/12/19 07:18:56 deraadt Exp $"); +RCSID("$OpenBSD: misc.c,v 1.15 2002/01/24 21:09:25 stevesk Exp $"); #include "misc.h" #include "log.h" @@ -92,6 +92,17 @@ unset_nonblock(int fd) fd, strerror(errno)); } +/* disable nagle on socket */ +void +set_nodelay(int fd) +{ + int on = 1; + + debug("fd %d setting TCP_NODELAY", fd); + if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on) == -1) + error("setsockopt TCP_NODELAY: %.100s", strerror(errno)); +} + /* Characters considered whitespace in strsep calls. */ #define WHITESPACE " \t\r\n" |