Bug 27918 - Callback for _gabble_connection_send_with_reply() may never be called.
Summary: Callback for _gabble_connection_send_with_reply() may never be called.
Status: NEW
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
Depends on:
Reported: 2010-04-30 12:37 UTC by Will Thompson
Modified: 2010-04-30 12:37 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Will Thompson 2010-04-30 12:37:50 UTC
So... I was reviewing some code today, and was getting annoyed that _gabble_connection_send_with_reply() can return either synchronously or asynchronously. So I had a poke at its implementation.

• _gabble_connection_send_with_reply() calls lm_connection_send_with_reply().
• lm_connection_send_with_reply() calls wocky_porter_send_iq_async, passing iq_reply_cb() as the callback.
• iq_reply_cb() in lib/loudmouth/lm-connection.c calls  wocky_porter_send_iq_finish(), and if it gets no reply, does not call the callback passed to _gabble_connection_send_with_reply()! So if you get disconnected, your callback will never be called, and we leak and/or die later.

I took a look at about half of the callbacks passed to _gabble_connection_send_with_reply() — it's actually only called 37 times — and the callbacks do indeed all assume that the reply message is not NULL. So... this seems pretty broken to me.

I think the right fix is to just remove one or more layers of wrapper around wocky_porter_send_iq_async(), to be honest.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.