summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendftp.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2009-06-12 14:22:16 +0200
committerBenjamin Otte <otte@gnome.org>2009-06-12 14:41:12 +0200
commitb18516a92cb5306b6f73de83e74a9af7ddd781c0 (patch)
tree0ce00fc24afa2f929a312b26b0ce50d3fdb59003 /daemon/gvfsbackendftp.c
parent1ef4f0d82da583c97c93052b6e4ccc632351746d (diff)
downloadgvfs-b18516a92cb5306b6f73de83e74a9af7ddd781c0.tar.gz
[FTP] rework data connection code
The new code doesn't rely on funny workaround flags anymore and also doesn't set workaround flags unconditionally after any failure. It now works like this: 1) if a default method exists, try the default method. 2) if the default method failed, try all methods in order until one succeeds. 3) if any method succeeded, make it the new default method. This way, we take the proper method by default, and have a proper fallback mechanism for flaky connections/servers that sometimes fail to connect properly. Also, it's much easier to add new methods (like active FTP) later.
Diffstat (limited to 'daemon/gvfsbackendftp.c')
-rw-r--r--daemon/gvfsbackendftp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index 18c8a7e4..ba6acd43 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -54,6 +54,23 @@
#include "gvfsftpfile.h"
#include "gvfsftptask.h"
+/*** GTK DOC ***/
+
+/**
+ * GVfsFtpMethod:
+ * @G_VFS_FTP_METHOD_UNKNOWN: method has not yet been determined
+ * @G_VFS_FTP_METHOD_EPSV: use EPSV command
+ * @G_VFS_FTP_METHOD_PASV: use PASV command
+ * @G_VFS_FTP_METHOD_PASV_ADDR: use PASV command, but ignore the returned
+ * address and only use it's port
+ * @G_VFS_FTP_METHOD_EPRT: use the EPRT command
+ * @G_VFS_FTP_METHOD_PORT: use the PORT command
+ *
+ * Possible methods for creating data connections to the ftp server. If the
+ * method is @G_VFS_FTP_METHOD_UNKNOWN, all possibilities are tried.
+ */
+
+
/*
* about filename interpretation in the ftp backend
*
@@ -68,6 +85,8 @@
* paths exactly match those of a TVFS-using FTP server.
*/
+/** CODE ***/
+
G_DEFINE_TYPE (GVfsBackendFtp, g_vfs_backend_ftp, G_VFS_TYPE_BACKEND)
static gboolean