summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-04-26 12:08:15 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-04-26 12:08:15 +0100
commit6e98f6603c150c5655683de6076c0e8f39099c02 (patch)
treeec1a18d1e4b6b69c57dbac9da9c712dd87c82d1e
parent42ea1fec2dae88947d3a821ef73cc06067d6f3a6 (diff)
channel: send item-not-found if the channel is closed before replying
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--salut/message-channel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/salut/message-channel.c b/salut/message-channel.c
index 5eebb84..6747068 100644
--- a/salut/message-channel.c
+++ b/salut/message-channel.c
@@ -325,6 +325,23 @@ ytst_message_channel_close (TpBaseChannel *chan)
YtstMessageChannel *self = YTST_MESSAGE_CHANNEL (chan);
YtstMessageChannelPrivate *priv = self->priv;
+ DEBUG ("called\n");
+
+ /* Need to send an item-not-found reply */
+ if (!tp_base_channel_is_requested (chan) && !priv->replied)
+ {
+ TpBaseConnection *conn = tp_base_channel_get_connection (
+ TP_BASE_CHANNEL (self));
+ WockySession *session = salut_connection_get_session (
+ SALUT_CONNECTION (conn));
+
+ wocky_porter_send_iq_error (
+ wocky_session_get_porter (session),
+ priv->request, WOCKY_XMPP_ERROR_ITEM_NOT_FOUND,
+ "channel closed before reply was sent; possibly "
+ "no handler found?");
+ }
+
if (!g_cancellable_is_cancelled (priv->cancellable))
g_cancellable_cancel (priv->cancellable);