summaryrefslogtreecommitdiff
path: root/agent/conncheck.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-06-29 16:30:12 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2015-09-03 22:06:11 +0100
commit2eaa8b3277f4f39515ff5dc7b512a44fd79e7275 (patch)
tree8da2acae79bb1b4f77b40d1d968c3f7d214c122c /agent/conncheck.c
parent3f54b333525e2a4ae35e0be439062900fb8ab7c3 (diff)
downloadlibnice-2eaa8b3277f4f39515ff5dc7b512a44fd79e7275.tar.gz
agent: Add assertions to check component state transitions are valid
There is no point in the NiceComponents having a state machine if the state transition graph is not documented or enforced. Document and enforce it. http://phabricator.freedesktop.org/T120
Diffstat (limited to 'agent/conncheck.c')
-rw-r--r--agent/conncheck.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 1b687b6..7832339 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -1326,6 +1326,15 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, Stream *st
* any that are kept, then this function will be called again when the
* conncheck tick timer finishes them all */
if (priv_prune_pending_checks (stream, component->id) == 0) {
+ /* Continue through the states to give client code a nice
+ * logical progression. See http://phabricator.freedesktop.org/D218 for
+ * discussion. */
+ if (component->state < NICE_COMPONENT_STATE_CONNECTING)
+ agent_signal_component_state_change (agent, stream->id, component->id,
+ NICE_COMPONENT_STATE_CONNECTING);
+ if (component->state < NICE_COMPONENT_STATE_CONNECTED)
+ agent_signal_component_state_change (agent, stream->id, component->id,
+ NICE_COMPONENT_STATE_CONNECTED);
agent_signal_component_state_change (agent, stream->id,
component->id, NICE_COMPONENT_STATE_READY);
}