[gvfs] afp: exit silently if connection closed



commit 8fdf64272ec47315cdd3e12d1aa628ad3bb837bc
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Feb 27 10:22:22 2015 +0100

    afp: exit silently if connection closed
    
    Commit c15ec62 introduced exit for G_IO_ERROR_CLOSED, however we
    should check also for G_IO_ERROR_CONNECTION_CLOSED.
    
    Bump GLib dependency to 2.43.2, where the error was introduced.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710490

 configure.ac               |    2 +-
 daemon/gvfsafpconnection.c |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index eea6365..f90c4ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,7 +61,7 @@ GTK_DOC_CHECK
 DISTCHECK_CONFIGURE_FLAGS="--enable-gtk-doc"
 AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
 
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.37.0 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0 )
+PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.43.2 gobject-2.0 gmodule-no-export-2.0 gio-unix-2.0 gio-2.0 )
 
 PKG_CHECK_MODULES(DBUS, dbus-1)
 
diff --git a/daemon/gvfsafpconnection.c b/daemon/gvfsafpconnection.c
index 2f2958d..c8ccad7 100644
--- a/daemon/gvfsafpconnection.c
+++ b/daemon/gvfsafpconnection.c
@@ -1074,7 +1074,8 @@ read_data_cb (GObject *object, GAsyncResult *res, gpointer user_data)
   result = read_all_finish (input, res, NULL, &err);
   if (!result)
   {
-    if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CLOSED))
+    if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
+        g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED))
     {
       g_message (_("Host closed connection"));
       exit(0);
@@ -1115,7 +1116,8 @@ read_dsi_header_cb (GObject *object, GAsyncResult *res, gpointer user_data)
   result = read_all_finish (input, res, NULL, &err);
   if (!result)
   {
-    if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CLOSED))
+    if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
+        g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED))
     {
       g_message (_("Host closed connection"));
       exit(0);


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