[Bug 34932] Use WockyMetaPorter

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 22 20:26:48 CET 2011


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

--- Comment #1 from Will Thompson <will.thompson at collabora.co.uk> 2011-03-22 12:26:47 PDT ---
I think it's stupid that the application has to deal with adding timeouts and
_force_close_async(). _close_async() should take a timeout. I've filed Bug
35548.

+  for (l = priv->resolvers; l != NULL; l = l->next)
+    {
+      GaServiceResolver *resolver = l->data;
+      AvahiAddress address;
+      guint16 port;
+      AvahiIfIndex ifindex;
+
+      g_object_get (resolver, "interface", &ifindex, NULL);

… and 'ifindex' is never used. What's it meant to be for? Where's this code
from?

+          socket_address = g_inet_socket_address_new (addr, port);
+          /* socket_address owns addr now */
+          g_object_unref (addr);

This comment is misleading—either it's taken its own ref and we can release the
one we own, or it's stolen ours and we can't. Which is it? I'm gonna guess the
former, which I don't think needs commenting.

+          addresses = g_list_append (addresses, socket_address);

<http://en.wikipedia.org/wiki/Schlemiel_the_Painter's_algorithm>. Yeah, it's
not a big deal here, but this is one reason I like stack-allocated GQueues: you
can build GLists with repeated O(1) append. I guess this isn't new code though.

avahi-contact-manager: add contacts to Wocky's contact factory too when created

Don't we also want to remove them when they're removed?

The whole of send_item_not_found can be replaced with
wocky_porter_send_iq_error() but I guess the whole of salut-disco.c will be
replaced with code in Wocky so.

salut_disco_request() documents its 'object' parameter  thusly:

 * @object: GObject to bind request to. the callback will not be
 *          called if this object has been unrefed. NULL if not needed

But as far as I can tell, that's not true any more. If the object dies, the
cancellable is cancelled, which will lead to the send_iq callback being called.
_finish() will return an error, which will be happily handed to the callback.

It looks like the only code paths which cancel the cancellable are those which
mean the callback shouldn't be called, so you could just bolt an is_cancelled()
check into disco_request_sent_cb().

+  if (wocky_node_get_child_ns (wocky_stanza_get_top_node (stanza), "invite",
+        GIBBER_TELEPATHY_NS_CLIQUE) != NULL)
+    /* discard Clique MUC invite */
     return FALSE;

I know this comment isn't new, but it is misleading — we're not discarding it.

In gibber-file-transfer.c:


+      case PROP_PORTER:
+        {
+          self->priv->porter = g_value_dup_object (value);
+
+          if (self->priv->porter != NULL)
+            {
+              self->priv->stanza_id =
+                wocky_porter_register_handler_from_anyone (self->priv->porter,
+                    WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE,
+                    WOCKY_PORTER_HANDLER_PRIORITY_NORMAL, received_stanza_cb,
+                    self, NULL);
+            }

Why would it be NULL?

I have reviewed up to and including “tubes-manager: stop using the XCM”.

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


More information about the telepathy-bugs mailing list