diff options
author | Fabrice Bellet <fabrice@bellet.info> | 2020-02-29 11:02:01 +0100 |
---|---|---|
committer | Fabrice Bellet <fabrice@bellet.info> | 2020-05-06 19:22:28 +0200 |
commit | 692b1055a9739ab135f629af1c327a3e43783b6c (patch) | |
tree | 7ff87226ed29fd62efee688ebc975238a72b9dce /agent/conncheck.c | |
parent | db9c2ca612482e49ae829d11a4a5eaad0058ed83 (diff) | |
download | libnice-692b1055a9739ab135f629af1c327a3e43783b6c.tar.gz |
conncheck: merge two cascaded conditions
Diffstat (limited to 'agent/conncheck.c')
-rw-r--r-- | agent/conncheck.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c index 324c373..7770376 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -3557,26 +3557,24 @@ static CandidateCheckPair *priv_process_response_check_for_reflexive(NiceAgent * nice_component_add_valid_candidate (agent, component, remote_candidate); } else { - if (!local_cand) { - if (!agent->force_relay) { - /* step: find a new local candidate, see RFC 5245 7.1.3.2.1. - * "Discovering Peer Reflexive Candidates" - * - * The priority equal to the value of the PRIORITY attribute - * in the Binding request is taken from the "parent" pair p - */ - local_cand = discovery_add_peer_reflexive_candidate (agent, - stream->id, - component->id, - p->stun_priority, - &mapped, - sockptr, - local_candidate, - remote_candidate); - nice_debug ("Agent %p : added a new peer-reflexive local candidate %p " - "with transport %s", agent, local_cand, - priv_candidate_transport_to_string (local_cand->transport)); - } + if (local_cand == NULL && !agent->force_relay) { + /* step: find a new local candidate, see RFC 5245 7.1.3.2.1. + * "Discovering Peer Reflexive Candidates" + * + * The priority equal to the value of the PRIORITY attribute + * in the Binding request is taken from the "parent" pair p + */ + local_cand = discovery_add_peer_reflexive_candidate (agent, + stream->id, + component->id, + p->stun_priority, + &mapped, + sockptr, + local_candidate, + remote_candidate); + nice_debug ("Agent %p : added a new peer-reflexive local candidate %p " + "with transport %s", agent, local_cand, + priv_candidate_transport_to_string (local_cand->transport)); } /* step: add a new discovered pair (see RFC 5245 7.1.3.2.2 |