summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2006-01-19 08:31:47 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2006-01-19 08:31:47 +0000
commit254f2fa20899ec7dc1c753592536f0f1e482e656 (patch)
treea75e9e9dbe881a3eda17cd3b452b88504ed63aab
parenta4922fdaf5b28a65f6a548bf0039a9f65b1cef4c (diff)
Notes
-rw-r--r--lib/libfetch/ftp.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index c504cbea2ea1..cd8ff0d94b80 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -322,8 +322,24 @@ _ftp_mode_type(conn_t *conn, int mode, int type)
default:
return (FTP_PROTOCOL_ERROR);
}
- if ((e = _ftp_cmd(conn, "MODE %c", mode)) != FTP_OK)
- return (e);
+ if ((e = _ftp_cmd(conn, "MODE %c", mode)) != FTP_OK) {
+ if (mode == 'S') {
+ /*
+ * Stream mode is supposed to be the default - so
+ * much so that some servers not only do not
+ * support any other mode, but do not support the
+ * MODE command at all.
+ *
+ * If "MODE S" fails, it is unlikely that we
+ * previously succeeded in setting a different
+ * mode. Therefore, we simply hope that the
+ * server is already in the correct mode, and
+ * silently ignore the failure.
+ */
+ } else {
+ return (e);
+ }
+ }
switch (type) {
case 0: