From 355a547423ad302b6f822d209a2a2c22b1512600 Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Thu, 26 Apr 2012 09:48:17 +0200 Subject: [PATCH] ServerConnection: make the complete "in idle" for _write_wait Telepathy idle ends up with "Connection time out" all the time. It turns out that with glib/gio git master priv->msg_sending flag in idle-connection.c msg_queue_timeout_cb is set to FALSE in the _msg_queue_timeout_ready before behing set to TRUE. This leads to infinite msg_timed_out_cb calls (ie until the server send the connection timed out). The backtrace of the tp idle shows that : g_output_stream_write_real_async triggers _write_async_pollable and in this use case it ends up calling the non idle version g_simple_async_result_complete. All this happens before idle_server_connection_send_async with callback _msg_queue_timeout_ready completes. As this callback set back priv->msg_sending to FALSE, and the initialization of this variable to TRUE happens after the idle_server_connection_send_async call, priv->msg_sending stays at TRUE until connection is aborted by the server. To avoid this the patch calls g_simple_async_result_complete_in_idle instead ofg_simple_async_result_complete_in_idle in idle-server-connection.c function _write_ready. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=49163 --- src/idle-server-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c index 930a242..373b5c7 100644 --- a/src/idle-server-connection.c +++ b/src/idle-server-connection.c @@ -429,7 +429,7 @@ cleanup: g_object_unref(priv->cancellable); priv->cancellable = NULL; } - g_simple_async_result_complete(result); + g_simple_async_result_complete_in_idle(result); g_object_unref(result); } -- 1.7.10