[gvfs/gnome-3-12] ftp: Check connection is usable when acquiring



commit 562906889bde44f4ef9e7a34343f7c9339941ecb
Author: Benjamin Otte <otte redhat com>
Date:   Mon Aug 11 03:01:42 2014 +0200

    ftp: Check connection is usable when acquiring
    
    Qhen acquiring a cached connection, it might have timeout'ed or
    otherwise not be available anymore. We don't want these connection
    errors to propagate into the job we're handling and instead just acquire
    the next connection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=591054

 daemon/gvfsftptask.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c
index 185ffe2..10aeab4 100644
--- a/daemon/gvfsftptask.c
+++ b/daemon/gvfsftptask.c
@@ -205,7 +205,13 @@ g_vfs_ftp_task_acquire_connection (GVfsFtpTask *task)
 
       task->conn = g_queue_pop_head (ftp->queue);
       if (task->conn != NULL)
-        break;
+        {
+          if (g_vfs_ftp_connection_is_usable (task->conn))
+            break;
+
+          g_vfs_ftp_connection_free (task->conn);
+          task->conn = NULL;
+        }
 
       if (ftp->connections < ftp->max_connections)
         {


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