Commit d0b76154 authored by Olivier Crête's avatar Olivier Crête

agent: Prevent gather from being called multiple times

This can cause odd behaviors as it is not a idempotent function.
parent 029cfe08
......@@ -2123,6 +2123,12 @@ nice_agent_gather_candidates (
return FALSE;
}
if (stream->gathering_started) {
/* Stream is already gathering, ignore this call */
agent_unlock_and_emit (agent);
return TRUE;
}
nice_debug ("Agent %p : In %s mode, starting candidate gathering.", agent,
agent->full_mode ? "ICE-FULL" : "ICE-LITE");
......@@ -2276,7 +2282,7 @@ nice_agent_gather_candidates (
}
stream->gathering = TRUE;
stream->gathering_started = TRUE;
/* Only signal the new candidates after we're sure that the gathering was
* succesfful. But before sending gathering-done */
......
......@@ -72,6 +72,7 @@ struct _Stream
gchar remote_ufrag[NICE_STREAM_MAX_UFRAG];
gchar remote_password[NICE_STREAM_MAX_PWD];
gboolean gathering;
gboolean gathering_started;
gint tos;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment