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