Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/usr.bin/ftp Pull up following revision(s) (requested by l...



details:   https://anonhg.NetBSD.org/src/rev/327a279b3194
branches:  netbsd-9
changeset: 983931:327a279b3194
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Jun 14 11:45:48 2021 +0000

description:
Pull up following revision(s) (requested by lukem in ticket #1293):

        usr.bin/ftp/ftp.c: revision 1.172

set SO_KEEPALIVE on control connection

Attempt to prevent timeouts of the control connection by setting SO_KEEPALIVE.
This matches the equivalent behaviour in ftpd.

Note: This is a much simpler change than adding a background polling event
to invoke "STAT" (or "NOOP") on the control connection during a transfer.
(It's unclear from RFC 959 whether "NOOP" is even permitted during a transfer).

PR bin/56129

diffstat:

 usr.bin/ftp/ftp.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 956fdd32dbaf -r 327a279b3194 usr.bin/ftp/ftp.c
--- a/usr.bin/ftp/ftp.c Mon Jun 14 11:34:20 2021 +0000
+++ b/usr.bin/ftp/ftp.c Mon Jun 14 11:45:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftp.c,v 1.168.2.3 2021/06/14 11:28:28 martin Exp $     */
+/*     $NetBSD: ftp.c,v 1.168.2.4 2021/06/14 11:45:48 martin Exp $     */
 
 /*-
  * Copyright (c) 1996-2021 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@
 #if 0
 static char sccsid[] = "@(#)ftp.c      8.6 (Berkeley) 10/27/94";
 #else
-__RCSID("$NetBSD: ftp.c,v 1.168.2.3 2021/06/14 11:28:28 martin Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.168.2.4 2021/06/14 11:45:48 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -280,6 +280,11 @@
                goto bad;
        }
 
+       if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE,
+                       (void *)&on, sizeof(on)) == -1) {
+               DWARN("setsockopt %s (ignored)", "SO_KEEPALIVE");
+       }
+
        if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE,
                        (void *)&on, sizeof(on)) == -1) {
                DWARN("setsockopt %s (ignored)", "SO_OOBINLINE");



Home | Main Index | Thread Index | Old Index