summaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2017-11-26 17:49:25 +0100
committerOlivier CrĂȘte <olivier.crete@collabora.com>2018-03-23 13:56:15 -0400
commitb5dd5e2aa72a68ac9f027bbcc22700db84a35677 (patch)
tree640ac7a261d8d745c43884b3bd75fc4a1f511120 /agent
parent025d84b53bd4ffc0626dd25aa8351319f4d77944 (diff)
downloadlibnice-b5dd5e2aa72a68ac9f027bbcc22700db84a35677.tar.gz
conncheck: the conncheck send function may fail
With this patch, we put the pair in state failed if we cannot send the connection check, for example due to missing local credentials. Reviewed-by: Olivier CrĂȘte <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D1891
Diffstat (limited to 'agent')
-rw-r--r--agent/conncheck.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 11ef9c9..9618c3a 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -442,7 +442,11 @@ static gboolean priv_conn_check_initiate (NiceAgent *agent, CandidateCheckPair *
{
pair->state = NICE_CHECK_IN_PROGRESS;
nice_debug ("Agent %p : pair %p state IN_PROGRESS", agent, pair);
- conn_check_send (agent, pair);
+ if (conn_check_send (agent, pair)) {
+ pair->state = NICE_CHECK_FAILED;
+ nice_debug ("Agent %p : pair %p state FAILED", agent, pair);
+ return FALSE;
+ }
return TRUE;
}
@@ -1070,7 +1074,11 @@ static gboolean priv_conn_check_tick_unlocked (NiceAgent *agent)
if (pair) {
priv_print_conn_check_lists (agent, G_STRFUNC,
", got a pair from triggered check list");
- conn_check_send (agent, pair);
+ if (conn_check_send (agent, pair)) {
+ pair->state = NICE_CHECK_FAILED;
+ nice_debug ("Agent %p : pair %p state FAILED", agent, pair);
+ return FALSE;
+ }
return TRUE;
}