[telepathy-gabble/master] don't send vCard multiple vCard set requests at the same time

Dafydd Harries dafydd.harries at collabora.co.uk
Thu Aug 6 05:26:55 PDT 2009


This happened to work previously due to some nuances of how the IQ request
pipeline works, but there were still cases where it broke and Gabble crashed
due to an assertion failure.
---
 src/vcard-manager.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/vcard-manager.c b/src/vcard-manager.c
index 0a5253c..32a483c 100644
--- a/src/vcard-manager.c
+++ b/src/vcard-manager.c
@@ -999,14 +999,10 @@ manager_patch_vcard (GabbleVCardManager *manager,
   LmMessageNode *patched_vcard;
   GList *li;
 
+  /* We should only get here if we have outstanding edits to make, but we
+   * don't have a set request in progress.
+   */
   g_assert (priv->edits != NULL);
-
-  /* There can be only one SET request at any given time,
-   * because XMPP server will process requests sequentially.
-   * This function can only be called when GET request for
-   * our vcard returns, but if we do SET and then GET for
-   * our vcard, SET will always return first, and clear the
-   * pipeline item. Or so I hope. */
   g_assert (priv->edit_pipeline_item == NULL);
 
   msg = lm_message_new_with_sub_type (NULL, LM_MESSAGE_TYPE_IQ,
@@ -1117,8 +1113,10 @@ pipeline_reply_cb (GabbleConnection *conn,
     }
 
   /* We have freshly updated cache for our vCard, edit it if
-   * there are any pending edits */
-  if (entry->handle == base->self_handle && priv->edits != NULL)
+   * there are any pending edits and no outstanding set request.
+   */
+  if (entry->handle == base->self_handle && priv->edits != NULL &&
+      priv->edit_pipeline_item == NULL)
     {
       DEBUG("will patch vcard");
       manager_patch_vcard (manager, vcard_node);
-- 
1.5.6.5




More information about the telepathy-commits mailing list