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.
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: 2019-12-03 19:22 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


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.
Comment 1 GitLab Migration User 2019-12-03 19:22:23 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-gabble/issues/85.

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.