ftp(1) will reliably stall for me when doing uploads. I tracked the
problem down to the keep-alive option. Not sure how widespread this issue
is as I'd imagine it depends on what server is on the receiving end. But
here's a sample transcript which gets stuck every time and requires me to
kill the process... the patch below turns off this functionality by
default as it doesn't really work all that well for me for uploads.
(Downloads on this same server work fine though).
# ftp corvette.dreamhost.com
Connected to corvette.dreamhost.com.
220 DreamHost FTP Server
Name (corvette.dreamhost.com:XXXX): XXXX
331 Password required for XXXX
Password:
230 User XXXX logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I
ftp> put file
local: file remote: file
150 Opening BINARY mode data connection for file
28% |*********************************** | 1874 KB - stalled -
< the process stays frozen at this point... >
Index: ftp.1
===================================================================
RCS file: /usr/cvs/src/usr.bin/ftp/ftp.1,v
retrieving revision 1.79
diff -u -r1.79 ftp.1
--- ftp.1 9 Aug 2009 20:16:39 -0000 1.79
+++ ftp.1 12 Feb 2010 04:01:18 -0000
@@ -174,9 +174,7 @@
the control connection during a transfer.
Well-behaved servers queue those commands, and process them after the
transfer.
-By default,
-.Nm
-will send a byte every 60 seconds.
+By default, this functionality is turned off.
.It Fl m
Causes
.Nm
Index: ftp.c
===================================================================
RCS file: /usr/cvs/src/usr.bin/ftp/ftp.c,v
retrieving revision 1.79
diff -u -r1.79 ftp.c
--- ftp.c 6 Jun 2009 23:14:44 -0000 1.79
+++ ftp.c 12 Feb 2010 04:03:00 -0000
@@ -325,7 +325,7 @@
return (r);
}
-int keep_alive_timeout = 60; /* 0 -> no timeout */
+int keep_alive_timeout = 0; /* 0 -> no timeout */
static int full_noops_sent = 0;
static time_t last_timestamp = 0; /* 0 -> no measurement yet */