aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-19 21:11:59 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-19 21:33:53 +0800
commitf2f939e82822df06bcf35914888d4cb6c1158d99 (patch)
tree8ec57816a71e0de718c83d53f20ec4b5daa37163
parent9b3759d6a7c7ce4ec9c49cce1f7424270f19999d (diff)
downloadgsoc2013-empathy-f2f939e82822df06bcf35914888d4cb6c1158d99.tar
gsoc2013-empathy-f2f939e82822df06bcf35914888d4cb6c1158d99.tar.gz
gsoc2013-empathy-f2f939e82822df06bcf35914888d4cb6c1158d99.tar.bz2
gsoc2013-empathy-f2f939e82822df06bcf35914888d4cb6c1158d99.tar.lz
gsoc2013-empathy-f2f939e82822df06bcf35914888d4cb6c1158d99.tar.xz
gsoc2013-empathy-f2f939e82822df06bcf35914888d4cb6c1158d99.tar.zst
gsoc2013-empathy-f2f939e82822df06bcf35914888d4cb6c1158d99.zip
dispatcher_connection_invalidated_cb: terminate pending requests
-rw-r--r--libempathy/empathy-dispatcher.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 0f8474d87..e6bb4543f 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -335,8 +335,31 @@ dispatcher_connection_invalidated_cb (TpConnection *connection,
EmpathyDispatcher *self)
{
EmpathyDispatcherPriv *priv = GET_PRIV (self);
+ ConnectionData *connection_data;
DEBUG ("Error: %s", message);
+
+ /* Terminate pending requests, if any */
+ connection_data = g_hash_table_lookup (priv->connections, connection);
+ if (connection_data != NULL)
+ {
+ GList *l;
+ GError *error;
+
+ error = g_error_new_literal (domain, code, message);
+
+ for (l = connection_data->outstanding_requests; l != NULL;
+ l = g_list_next (l))
+ {
+ DispatcherRequestData *request_data = l->data;
+
+ if (request_data->cb != NULL)
+ request_data->cb (NULL, error, request_data->user_data);
+ }
+
+ g_error_free (error);
+ }
+
g_hash_table_remove (priv->connections, connection);
}