[glib] GNetworkService: fix iteration of multiple addresses



commit 19243c247d8a89c6467bd21109b7f0d4b1cb081a
Author: Dan Winship <danw gnome org>
Date:   Wed Sep 15 10:22:13 2010 -0400

    GNetworkService: fix iteration of multiple addresses
    
    Previously if there were multiple SRV records, only the first would
    be iterated by the GSocketConnectable interface

 gio/gnetworkservice.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gio/gnetworkservice.c b/gio/gnetworkservice.c
index cfeccca..78e1ab5 100644
--- a/gio/gnetworkservice.c
+++ b/gio/gnetworkservice.c
@@ -478,7 +478,10 @@ g_network_service_address_enumerator_next (GSocketAddressEnumerator  *enumerator
                 srv_enum->error = error;
               else
                 g_error_free (error);
+            }
 
+          if (!ret)
+            {
               g_object_unref (srv_enum->addr_enum);
               srv_enum->addr_enum = NULL;
             }
@@ -628,7 +631,10 @@ next_async_have_address (GObject      *source_object,
         srv_enum->error = error;
       else
         g_error_free (error);
+    }
 
+  if (!address)
+    {
       g_object_unref (srv_enum->addr_enum);
       srv_enum->addr_enum = NULL;
 



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