summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>2017-11-28 15:14:11 -0500
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>2017-11-28 16:45:37 -0500
commit4172d48852ecd1c86cc7bd4665b23697603d1eed (patch)
tree011a70813b1236bba3a5bac2a1259750a91b902c
parent59fcf95d505c3995f858b826d10cd48321ed383e (diff)
downloadlibnice-4172d48852ecd1c86cc7bd4665b23697603d1eed.tar.gz
discovery: Increase discovery_unsched_items whenever we restart a check
The discovery_unsched_items is decremented every time a DiscoveryCandidate goes from non-pending to pending. So if we restart a check by setting pending to FALSE, we should re-increase the discovery_unsched_items.
-rw-r--r--agent/conncheck.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 229c8b1..5b08311 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -3507,6 +3507,7 @@ static gboolean priv_map_reply_to_discovery_request (NiceAgent *agent, StunMessa
d->server = niceaddr;
d->pending = FALSE;
+ agent->discovery_unsched_items++;
} else if (res == STUN_USAGE_BIND_RETURN_SUCCESS) {
/* case: successful binding discovery, create a new local candidate */
@@ -3648,6 +3649,7 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
nice_address_set_from_sockaddr (&d->turn->server, &alternate.addr);
d->pending = FALSE;
+ agent->discovery_unsched_items++;
} else if (res == STUN_USAGE_TURN_RETURN_RELAY_SUCCESS ||
res == STUN_USAGE_TURN_RETURN_MAPPED_SUCCESS) {
/* case: successful allocate, create a new local candidate */
@@ -3776,6 +3778,7 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
nice_address_set_from_sockaddr (&d->turn->server, &alternate.addr);
d->pending = FALSE;
+ agent->discovery_unsched_items++;
}
}
/* check for unauthorized error response */
@@ -3798,6 +3801,7 @@ static gboolean priv_map_reply_to_relay_request (NiceAgent *agent, StunMessage *
d->stun_resp_msg.buffer = d->stun_resp_buffer;
d->stun_resp_msg.buffer_len = sizeof(d->stun_resp_buffer);
d->pending = FALSE;
+ agent->discovery_unsched_items++;
} else {
/* case: a real unauthorized error */
d->stun_message.buffer = NULL;