summaryrefslogtreecommitdiffstats
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 04ea7a79..fbdf408e 100644
--- a/misc.c
+++ b/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"