summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-08-11 03:01:42 +0200
committerRoss Lagerwall <rosslagerwall@gmail.com>2014-08-20 19:15:26 +0100
commit562906889bde44f4ef9e7a34343f7c9339941ecb (patch)
tree17fdfe538bee014c4f7f5a7efb532a089d30425d
parent9e3a0c2166d78477eb5032de4df4dda687142282 (diff)
downloadgvfs-562906889bde44f4ef9e7a34343f7c9339941ecb.tar.gz
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
-rw-r--r--daemon/gvfsftptask.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/daemon/gvfsftptask.c b/daemon/gvfsftptask.c
index 185ffe25..10aeab46 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)
{