[gvfs/gnome-3-10] ftp: Always close data connections when done



commit 0d30b628990db246a7a9fec4c43e4ca3a5df46b0
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 21 03:22:12 2013 +0100

    ftp: Always close data connections when done
    
    Opening data connections is a complex process and can fail in multiple
    stages. Instead of requiring the code to close them manually and
    throwing assertions when that doesn't work we just clean up after all
    jobs automatically.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711865

 daemon/gvfsftptask.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c
index 15de4ce..185ffe2 100644
--- a/daemon/gvfsftptask.c
+++ b/daemon/gvfsftptask.c
@@ -276,6 +276,8 @@ g_vfs_ftp_task_acquire_connection (GVfsFtpTask *task)
  * or frees it if it is in an error state. You must use this function to free
  * a @task's connection, never use g_vfs_ftp_connection_free() directly. If
  * the task does not have a current connection, this function just returns.
+ *
+ * This function also closes all potentially open data connections.
  **/
 static void
 g_vfs_ftp_task_release_connection (GVfsFtpTask *task)
@@ -286,6 +288,8 @@ g_vfs_ftp_task_release_connection (GVfsFtpTask *task)
   if (task->conn == NULL)
     return;
 
+  g_vfs_ftp_task_close_data_connection (task);
+
   g_mutex_lock (&task->backend->mutex);
   if (task->backend->queue && g_vfs_ftp_connection_is_usable (task->conn))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]