aboutsummaryrefslogtreecommitdiff
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1998-04-28 03:37:23 +0000
committerDavid Greenman <dg@FreeBSD.org>1998-04-28 03:37:23 +0000
commitdadb9fb3345a846cb8859f3e7f6285a38499bb82 (patch)
treeb0d9513690743b28e5fda7834295640a20f4ea8a /libexec/ftpd/ftpd.c
parent21a56c939ed2541542b3ea692fba15d48cf7a9c6 (diff)
downloadsrc-dadb9fb3345a846cb8859f3e7f6285a38499bb82.tar.gz
src-dadb9fb3345a846cb8859f3e7f6285a38499bb82.zip
Set TCP_NODELAY on the control channel to improve performance a bit.
Notes
Notes: svn path=/head/; revision=35482
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 7f40d6cc8897..fca0ad92fe15 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -44,7 +44,7 @@ static char copyright[] =
static char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$Id: ftpd.c,v 1.44 1997/12/24 19:13:22 imp Exp $";
+ "$Id: ftpd.c,v 1.45 1998/02/24 08:45:57 eivind Exp $";
#endif /* not lint */
/*
@@ -480,6 +480,13 @@ main(argc, argv, envp)
if (setsockopt(0, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)
syslog(LOG_WARNING, "setsockopt (IP_TOS): %m");
#endif
+ /*
+ * Disable Nagle on the control channel so that we don't have to wait
+ * for peer's ACK before issuing our next reply.
+ */
+ if (setsockopt(0, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0)
+ syslog(LOG_WARNING, "control setsockopt TCP_NODELAY: %m");
+
data_source.sin_port = htons(ntohs(ctrl_addr.sin_port) - 1);
/* set this here so klogin can use it... */