summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/ftp.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-12-07 10:34:59 +0000
committerpeter <peter@FreeBSD.org>1995-12-07 10:34:59 +0000
commit03382d7ccd5ed3c8bf17b6719df445c2d9c5dea6 (patch)
tree3d31cd880ab6a9af9ad3ab3c6313d70e1c542d60 /usr.sbin/sysinstall/ftp.c
parent53a232b78efd4ef6c84ff8047a3a43c3d8cf0a25 (diff)
downloadFreeBSD-src-03382d7ccd5ed3c8bf17b6719df445c2d9c5dea6.zip
FreeBSD-src-03382d7ccd5ed3c8bf17b6719df445c2d9c5dea6.tar.gz
Update the -current sources from the 2.1 branch.
Approved (in spirit) by: jkh
Diffstat (limited to 'usr.sbin/sysinstall/ftp.c')
-rw-r--r--usr.sbin/sysinstall/ftp.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c
index 59ffb6f..e4b2c3e 100644
--- a/usr.sbin/sysinstall/ftp.c
+++ b/usr.sbin/sysinstall/ftp.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: ftp.c,v 1.13.2.9 1995/06/05 18:34:15 jkh Exp $
+ * $Id: ftp.c,v 1.14.2.1 1995/10/21 14:06:35 jkh Exp $
*
* Return values have been sanitized:
* -1 error, but you (still) have a session.
@@ -34,6 +34,9 @@
/* Handy global for us to stick the port # */
int FtpPort;
+/* How to see by a given code whether or not the connection has timed out */
+#define FTP_TIMEOUT(code) (code == 421)
+
#ifndef STANDALONE_FTP
#include "sysinstall.h"
#endif /*STANDALONE_FTP*/
@@ -288,7 +291,7 @@ FtpGet(FTP_t ftp, char *file)
return botch(ftp,"FtpGet","open");
if(ftp->binary) {
i = cmd(ftp,"TYPE I");
- if (i < 0)
+ if (i < 0 || FTP_TIMEOUT(i))
return zap(ftp);
if (i > 299)
return -1;
@@ -331,7 +334,7 @@ FtpGet(FTP_t ftp, char *file)
}
ftp->fd_xfer = s;
i = cmd(ftp,"RETR %s",file);
- if (i < 0) {
+ if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
return zap(ftp);
}
@@ -374,11 +377,14 @@ FtpGet(FTP_t ftp, char *file)
close(s);
return zap(ftp);
}
- else if (i > 299) {
+ else if (i > 299 || FTP_TIMEOUT(i)) {
if (isDebug())
msgDebug("FTP: No such file %s, moving on.\n", file);
close(s);
- return -1;
+ if (FTP_TIMEOUT(i))
+ return zap(ftp);
+ else
+ return -1;
}
ftp->fd_xfer = accept(s, 0, 0);
if (ftp->fd_xfer < 0) {
OpenPOWER on IntegriCloud