summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2011-05-24 18:44:33 +0100
committerVivek Dasmohapatra <vivek@collabora.co.uk>2011-05-24 18:44:33 +0100
commit0c3f44720632f76c5b4f90799314fb45fdd54c41 (patch)
treef62c02038700f3d964250648cb15f0c5d9630849
parent964891e770dd1ca66c7c9a51ae03cc71dba8fe1a (diff)
parent232cc604d7827c51456534976cf8c69446b3418b (diff)
downloadtelepathy-mission-control-0c3f44720632f76c5b4f90799314fb45fdd54c41.tar.gz
Merge branch 'cd-message-api-fixes' into telepathy-mission-control-5.8
-rw-r--r--src/mcd-dispatcher.c23
-rw-r--r--src/request.c10
2 files changed, 24 insertions, 9 deletions
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 54d1400a..7b16f6a9 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1678,6 +1678,8 @@ _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher,
McdChannel *channel, McdChannel *request)
{
McdChannelStatus status;
+ McdRequest *origin = _mcd_channel_get_request (request);
+ gboolean internal = _mcd_request_is_internal (origin);
status = mcd_channel_get_status (channel);
@@ -1685,29 +1687,32 @@ _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher,
* is not, @request must mirror the status of @channel */
if (status == MCD_CHANNEL_STATUS_DISPATCHED)
{
- McdRequest *origin = _mcd_channel_get_request (request);
- DEBUG ("reinvoking handler on channel %p", channel);
+ DEBUG ("reinvoking handler on channel %p", request);
/* copy the object path and the immutable properties from the
* existing channel */
_mcd_channel_copy_details (request, channel);
- DEBUG ("checking if ensured channel should be handled internaly");
- if (_mcd_request_is_internal (origin))
+ if (internal)
_mcd_request_handle_internally (origin, request, FALSE);
else
_mcd_dispatcher_reinvoke_handler (dispatcher, request);
}
else
{
- const gchar *preferred_handler =
- _mcd_channel_get_request_preferred_handler (request);
-
+ DEBUG ("non-reinvoked handling of channel %p", request);
_mcd_channel_set_request_proxy (request, channel);
- if (status == MCD_CHANNEL_STATUS_DISPATCHING)
+
+ if (internal)
+ {
+ _mcd_request_handle_internally (origin, request, FALSE);
+ }
+ else if (status == MCD_CHANNEL_STATUS_DISPATCHING)
{
McdDispatchOperation *op = find_operation_from_channel (dispatcher,
channel);
+ const gchar *preferred_handler =
+ _mcd_channel_get_request_preferred_handler (request);
g_return_if_fail (op != NULL);
@@ -2291,7 +2296,7 @@ send_message_got_channel (McdRequest *request,
_mcd_request_unblock_account (message->account_path);
message_context_return_error (message, error);
- message_context_free (message);
+ _mcd_request_clear_internal_handler (request);
g_error_free (error);
}
}
diff --git a/src/request.c b/src/request.c
index a7bc0a03..0abef720 100644
--- a/src/request.c
+++ b/src/request.c
@@ -277,6 +277,15 @@ _mcd_request_dispose (GObject *object)
DEBUG ("%p", object);
+ /* shouldn't ever actually get this far with a blocked account, *
+ * but we have to clear the lock if we do or we'll deadlock */
+ if (_mcd_request_is_internal (self) && self->account != NULL)
+ {
+ const gchar *path = mcd_account_get_object_path (self->account);
+ _mcd_request_unblock_account (path);
+ g_warning ("internal request disposed without being handled or failed");
+ }
+
tp_clear_object (&self->account);
tp_clear_object (&self->clients);
tp_clear_object (&self->predicted_handler);
@@ -455,6 +464,7 @@ _mcd_request_handle_internally (McdRequest *self,
{
if (self->internal_handler != NULL)
{
+ DEBUG ("Handling request %p, channel %p internally", self, channel);
self->internal_handler (self, channel, self->internal_handler_data,
close_after);