Commit edadfe7b authored by Kai Vehmanen's avatar Kai Vehmanen

Implement delayed processing of early incoming connectivity checks.

darcs-hash:20071126103228-77cd4-6cbe09665aa050c1b5b577c20886f98203d0ce4e.gz
parent fda1e268
......@@ -996,6 +996,8 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
added = -1;
}
conn_check_remote_candidates_set(agent);
if (added > 0) {
gboolean res = conn_check_schedule_next (agent);
if (res != TRUE)
......
......@@ -94,13 +94,17 @@ component_free (Component *cmp)
GSource *source = i->data;
g_source_destroy (source);
}
g_slist_free (cmp->gsources),
cmp->gsources = NULL;
for (i = cmp->incoming_checks; i; i = i->next) {
IncomingCheck *icheck = i->data;
g_slice_free (IncomingCheck, icheck);
}
g_slist_free (cmp->local_candidates);
g_slist_free (cmp->remote_candidates);
g_slist_free (cmp->sockets);
g_slist_free (cmp->gsources), cmp->gsources = NULL;
g_slist_free (cmp->incoming_checks);
g_slice_free (Component, cmp);
}
......@@ -192,6 +196,11 @@ component_restart (Component *cmp)
g_slist_free (cmp->remote_candidates),
cmp->remote_candidates = NULL;
for (i = cmp->incoming_checks; i; i = i->next) {
IncomingCheck *icheck = i->data;
g_slice_free (IncomingCheck, icheck);
}
/* note: component state managed by agent */
return TRUE;
......
......@@ -54,6 +54,7 @@ G_BEGIN_DECLS
typedef struct _Component Component;
typedef struct _CandidatePair CandidatePair;
typedef struct _IncomingCheck IncomingCheck;
struct _CandidatePair
{
......@@ -62,6 +63,14 @@ struct _CandidatePair
guint64 priority; /**< candidate pair priority */
};
struct _IncomingCheck
{
NiceAddress from;
NiceUDPSocket *local_socket;
uint32_t priority;
gboolean use_candidate;
};
struct _Component
{
NiceComponentType type;
......@@ -71,6 +80,7 @@ struct _Component
GSList *remote_candidates; /**< list of Candidate objs */
GSList *sockets; /**< list of NiceUDPSocket objs */
GSList *gsources; /**< list of GSource objs */
GSList *incoming_checks; /**< list of IncomingCheck objs */
CandidatePair selected_pair; /**< independent from checklists,
see ICE 11.1. "Sending Media" (ID-19) */
gboolean media_after_tick; /**< true if media received since last
......
This diff is collapsed.
......@@ -85,5 +85,6 @@ int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
gboolean conn_check_prune_stream (NiceAgent *agent, Stream *stream);
gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, Component *component, NiceUDPSocket *udp_socket, const NiceAddress *from, gchar *buf, guint len);
gint conn_check_compare (const CandidateCheckPair *a, const CandidateCheckPair *b);
void conn_check_remote_candidates_set(NiceAgent *agent);
#endif /*_NICE_CONNCHECK_H */
......@@ -435,6 +435,7 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N
g_main_loop_run (global_mainloop);
g_assert (global_ragent_ibr_received == TRUE);
g_assert (global_components_failed == 0);
/* note: test payload send and receive */
global_ragent_read = 0;
......
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