summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-08-11 03:10:28 +0200
committerBenjamin Otte <otte@redhat.com>2014-08-11 03:15:54 +0200
commit9bd1bd2c7a96b69ef4de956eb04d3bb58f748c0e (patch)
treec0f62a1a206af20a5e6fb10f8ae871ee1c88c06c
parent648c433bfbc88aaa757a0adb86b20ca3c986108b (diff)
downloadgvfs-9bd1bd2c7a96b69ef4de956eb04d3bb58f748c0e.tar.gz
ftp: Also mark connection as unusable on G_IO_IN
There is data waiting on an FTP connection and we didn't request it. It's not ours and we have no way to clear it. Just makr this connection as unusable. Most likely this is the server notifying us about a timeout or other connection abort, so it's a good idea to treat it as an error anyway. Also includes a new debug message for when we mark a connection as unusuable and why. https://bugzilla.gnome.org/show_bug.cgi?id=591054
-rw-r--r--daemon/gvfsftpconnection.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/daemon/gvfsftpconnection.c b/daemon/gvfsftpconnection.c
index 8576b48a..edfffacf 100644
--- a/daemon/gvfsftpconnection.c
+++ b/daemon/gvfsftpconnection.c
@@ -479,10 +479,16 @@ g_vfs_ftp_connection_is_usable (GVfsFtpConnection *conn)
if (conn->waiting_for_reply)
return FALSE;
- cond = G_IO_ERR | G_IO_HUP;
+ cond = G_IO_ERR | G_IO_HUP | G_IO_IN;
cond = g_socket_condition_check (g_socket_connection_get_socket (G_SOCKET_CONNECTION (conn->commands)), cond);
if (cond)
- return FALSE;
+ {
+ g_debug ("##%2d ## connection unusuable: %s%s%s\r\n", conn->debug_id,
+ cond & G_IO_IN ? "IN " : "",
+ cond & G_IO_HUP ? "HUP " : "",
+ cond & G_IO_ERR ? "ERR " : "");
+ return FALSE;
+ }
return TRUE;
}