From 3f47a3231dd1d0881fca5142e4131dadd6a8317b Mon Sep 17 00:00:00 2001 From: dg Date: Tue, 28 Apr 1998 03:37:23 +0000 Subject: Set TCP_NODELAY on the control channel to improve performance a bit. --- libexec/ftpd/ftpd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libexec/ftpd') diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 7f40d6c..fca0ad9 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... */ -- cgit v1.1