summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch')
-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 c504cbe..cd8ff0d 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:
OpenPOWER on IntegriCloud