telepathy-idle: connection: cope with send_async() returning synchronously

Will Thompson wjt at kemper.freedesktop.org
Tue Oct 30 10:40:54 PDT 2012


Module: telepathy-idle
Branch: master
Commit: ba22cc02a652a2ccfe6b59b113a87b2fe3761543
URL:    http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=ba22cc02a652a2ccfe6b59b113a87b2fe3761543

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Tue Oct 30 17:32:56 2012 +0000

connection: cope with send_async() returning synchronously

On <https://bugs.freedesktop.org/show_bug.cgi?id=49163>, Alban Browaeys
described a situation where idle_server_connection_send_async() would
call its callback synchronously, due to a bug in GLib. While I think
that bug is fixed, we can be more defensive against this by initializing
priv->msg_sending to TRUE before calling
idle_server_connection_send_async() rather than after. That way, if the
_msg_queue_timeout_ready() callback is called synchronously (due to a
bug), Idle won't get stuck thinking it's sending a message.

---

 src/idle-connection.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/idle-connection.c b/src/idle-connection.c
index a65bc70..d48564d 100644
--- a/src/idle-connection.c
+++ b/src/idle-connection.c
@@ -862,9 +862,9 @@ static gboolean msg_queue_timeout_cb(gpointer user_data) {
 		return FALSE;
 	}
 
+	priv->msg_sending = TRUE;
 	idle_server_connection_send_async(priv->conn, output_msg->message, NULL, _msg_queue_timeout_ready, conn);
 	idle_output_pending_msg_free (output_msg);
-	priv->msg_sending = TRUE;
 
 	return TRUE;
 }



More information about the telepathy-commits mailing list