Commit 7037ab4c authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Philip Withnall

conncheck: implement a "triggered queue" list

The checks should not be sent immediately in priv_conn_check_initiate(),
but be put into the "triggered queue", see  "7.2.1.4 Triggered Checks".
This patch implements this triggered checks list, and uses it to enforce a
pacing of STUN transactions, no more than one per Ta ms, according to
"B.1. Pacing of STUN Transactions".
Reviewed-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: default avatarPhilip Withnall <philip@tecnocode.co.uk>
Differential Revision: https://phabricator.freedesktop.org/D802
parent 1732c7d6
......@@ -139,6 +139,7 @@ struct _NiceAgent
guint next_stream_id; /* id of next created candidate */
NiceRNG *rng; /* random number generator */
GSList *discovery_list; /* list of CandidateDiscovery items */
GSList *triggered_check_queue; /* pairs in the triggered check list */
guint discovery_unsched_items; /* number of discovery items unscheduled */
GSource *discovery_timer_source; /* source of discovery timer */
GSource *conncheck_timer_source; /* source of conncheck timer */
......
......@@ -3272,9 +3272,7 @@ _set_remote_candidates_locked (NiceAgent *agent, NiceStream *stream,
conn_check_remote_candidates_set(agent);
if (added > 0) {
gboolean res = conn_check_schedule_next (agent);
if (res != TRUE)
nice_debug ("Agent %p : Warning: unable to schedule any conn checks!", agent);
conn_check_schedule_next (agent);
}
return added;
......
This diff is collapsed.
......@@ -98,7 +98,7 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, NiceCompone
int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *local);
gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *local, NiceCandidate *remote);
void conn_check_free (NiceAgent *agent);
gboolean conn_check_schedule_next (NiceAgent *agent);
void conn_check_schedule_next (NiceAgent *agent);
int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
void conn_check_prune_stream (NiceAgent *agent, NiceStream *stream);
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream, NiceComponent *component, NiceSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len);
......
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