summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendftp.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2009-04-26 14:11:52 +0200
committerBenjamin Otte <otte@gnome.org>2009-04-26 14:11:52 +0200
commit22c55fb6df556517cac030fd4fafce46c9aa0342 (patch)
treeeceaa4fbb86e5c3a50cdb766f3842f3bba74b62f /daemon/gvfsbackendftp.c
parente53be4e80e9194ad4917102e243cecec7bd2a665 (diff)
downloadgvfs-22c55fb6df556517cac030fd4fafce46c9aa0342.tar.gz
Bug 580125 – Logging in to a FTP server only works for the 2nd attempt
Various fixes for sending the OPTS command: 1) only send it after we're sure we've read the FEAT response (which moves it to after the login) 2) ignore potential errors from the OPTS command Also fixes: Bug 580124 – Copying from FTP crashes
Diffstat (limited to 'daemon/gvfsbackendftp.c')
-rw-r--r--daemon/gvfsbackendftp.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index 02e1ac92..e650dd04 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -787,10 +787,6 @@ ftp_connection_prepare (FtpConnection *conn)
conn->workarounds |= FTP_WORKAROUND_FEAT_AFTER_LOGIN;
conn->features = 0;
}
-
- /* instruct server that we'll give and assume we get utf8 */
- if (conn->features & FTP_FEATURE_UTF8)
- ftp_connection_send (conn, 0, "OPTS UTF8 ON");
}
static gboolean
@@ -822,14 +818,21 @@ ftp_connection_use (FtpConnection *conn)
if (ftp_connection_send (conn, 0, "FEAT") != 0) {
ftp_connection_parse_features (conn);
} else {
- ftp_connection_clear_error(conn);
+ ftp_connection_clear_error (conn);
conn->features = FTP_FEATURES_DEFAULT;
}
}
+ /* instruct server that we'll give and assume we get utf8 */
+ if (conn->features & FTP_FEATURE_UTF8)
+ {
+ if (!ftp_connection_send (conn, 0, "OPTS UTF8 ON"))
+ ftp_connection_clear_error (conn);
+ }
+
if (ftp_connection_send (conn, 0, "SYST"))
ftp_connection_parse_system (conn);
- ftp_connection_clear_error(conn);
+ ftp_connection_clear_error (conn);
return TRUE;
}