[telepathy-gabble/master] Prevent LmConn disconnection callback firing twice

Will Thompson will.thompson at collabora.co.uk
Thu Apr 16 05:16:44 PDT 2009


This currently wouldn't happen, because Gabble happens to only react to
stream errors that Loudmouth ignores.
---
 src/connection.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 3ea0a9a..b384f28 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1383,6 +1383,13 @@ connection_disconnected_cb (LmConnection *lmconn,
           TP_CONNECTION_STATUS_DISCONNECTED,
           TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
     }
+
+  /* Under certain circumstances, Loudmouth would end up calling this twice,
+   * because sometimes it calls it in response to a stream error, and sometimes
+   * it doesn't. (It depends on the error!) We don't want this to be called
+   * twice, so:
+   */
+  lm_connection_set_disconnect_function (lmconn, NULL, NULL, NULL);
 }
 
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list