GNetworkService: fix iteration of multiple addresses
authorDan Winship <danw@gnome.org>
Wed, 15 Sep 2010 14:22:13 +0000 (10:22 -0400)
committerDan Winship <danw@gnome.org>
Fri, 22 Oct 2010 18:59:35 +0000 (14:59 -0400)
Previously if there were multiple SRV records, only the first would
be iterated by the GSocketConnectable interface

gio/gnetworkservice.c

index cfeccca..78e1ab5 100644 (file)
@@ -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;