[telepathy-gabble/master] Assert if set_state is incorrectly passed a reason
Will Thompson
will.thompson at collabora.co.uk
Fri Mar 27 04:37:53 PDT 2009
---
src/jingle-session.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/jingle-session.c b/src/jingle-session.c
index ff798c2..b47a576 100644
--- a/src/jingle-session.c
+++ b/src/jingle-session.c
@@ -1539,7 +1539,7 @@ try_session_initiate_or_accept (GabbleJingleSession *sess)
* @sess: a jingle session
* @state: the new state for the session
* @termination_reason: if @state is JS_STATE_ENDED, the reason the session
- * ended. Otherwise, ignored.
+ * ended. Otherwise, must be 0.
*/
static void
set_state (GabbleJingleSession *sess,
@@ -1554,6 +1554,9 @@ set_state (GabbleJingleSession *sess,
return;
}
+ if (state != JS_STATE_ENDED)
+ g_assert (termination_reason == 0);
+
DEBUG ("Setting state of JingleSession: %p (priv = %p) from %u to %u", sess, priv, priv->state, state);
priv->state = state;
--
1.5.6.5
More information about the telepathy-commits
mailing list