[Bug 47429] Support SalutContact and SautContact-manager with Bonjour backend

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 26 10:51:50 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=47429

Olli Salli <olli.salli at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |review-

--- Comment #14 from Olli Salli <olli.salli at collabora.co.uk> 2012-03-26 01:51:50 PDT ---
> bonjour-contact-manager: Unref contact only if it has no services

Yes good but...

> +          if (salut_bonjour_contact_has_services
> +              (SALUT_BONJOUR_CONTACT (contact)))
> +            {
> +              g_object_unref (contact);
> +            }

This is the exact opposite. Can you please test your changes in some way? (Or
look at the diffs yourself to see if they make sense). In this case, you should
see your contacts disposed when they disappear from the network.

Service ref management looks good now.

Contact:

       DEBUG ("Address resolving failed with : (%d)", _error_type);
+      _salut_bonjour_resolve_ctx_free (self, ctx);
       return;

This is wrong - your resolver still exists although this one GetAddrInfo
would've somehow failed. Specifically the resolve_cb will be called on a freed
ctx from this on. So don't _free here.

       DEBUG ("Resolver failed with : (%d)", error_type);
-      g_free (ctx->txt_record);
-      ctx->txt_length = 0;
-      salut_bonjour_discovery_client_drop_svc_ref (priv->discovery_client,
-          ctx->address_ref);
+      _salut_bonjour_resolve_ctx_free (self, ctx);
       return;

Also this. You'll want to free this particular TXT record and drop the svc ref
(setting to NULL so you don't think they exist later), but you don't want to
kill the resolver struct.

You still just
>      g_slice_free (SalutBonjourResolveCtx, ctx);
in _dispose - should use ctx_free so you don't leak the dup'd members and still
have any running address refs active etc.

You *should keep* the
>       salut_bonjour_discovery_client_drop_svc_ref (priv->discovery_client,
>          ctx->resolve_ref);
here separately though *as it is*, as your ctx_free doesn't drop the
resolve_ref.

Otherwise all good. Let's fix these, double-check it works, and merge.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list