diff options
author | Benjamin Otte <otte@redhat.com> | 2014-08-11 03:01:42 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2014-08-11 03:15:54 +0200 |
commit | 648c433bfbc88aaa757a0adb86b20ca3c986108b (patch) | |
tree | 5cd84fb350ce19320dfc65c6b8e93caa530e3c8e | |
parent | 232d6d76029dc1cbc0c76c2459f9db26b7717d28 (diff) | |
download | gvfs-648c433bfbc88aaa757a0adb86b20ca3c986108b.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.c | 8 |
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) { |