summaryrefslogtreecommitdiff
path: root/agent/component.c
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2020-02-08 22:00:57 +0100
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2020-02-13 21:27:46 +0000
commitbbcf82b3fcdc8240aa653252210d3005eb087d46 (patch)
tree5e4fc31d83c99cb8a273a94cbf7abe89554469ea /agent/component.c
parent76f6df3c5358332127032fc222a218b113659dae (diff)
downloadlibnice-bbcf82b3fcdc8240aa653252210d3005eb087d46.tar.gz
conncheck: display priorities in debug by spliting their values
We display 32-bit candidate priorities in hexadecimal to identify each 8-bit-aligned field more easily: type preference, local preference, and component id. We display 64-bit pair priority by splitting their local and remote part. See RFC-8445, section 5.1.2.1. "Recommended Formula", and section 6.1.2.3. "Computing Pair Priority and Ordering Pairs".
Diffstat (limited to 'agent/component.c')
-rw-r--r--agent/component.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/agent/component.c b/agent/component.c
index 10fb32b..43d4bdd 100644
--- a/agent/component.c
+++ b/agent/component.c
@@ -474,15 +474,17 @@ void
nice_component_update_selected_pair (NiceAgent *agent, NiceComponent *component, const CandidatePair *pair)
{
NiceStream *stream;
+ gchar priority[NICE_CANDIDATE_PAIR_PRIORITY_MAX_SIZE];
g_assert (component);
g_assert (pair);
stream = agent_find_stream (agent, component->stream_id);
- nice_debug ("setting SELECTED PAIR for component %u: %s:%s (prio:%"
- G_GUINT64_FORMAT ").", component->id, pair->local->foundation,
- pair->remote->foundation, pair->priority);
+ nice_candidate_pair_priority_to_string (pair->priority, priority);
+ nice_debug ("setting SELECTED PAIR for component %u: %s:%s (prio:%s).",
+ component->id, pair->local->foundation,
+ pair->remote->foundation, priority);
if (component->selected_pair.local &&
component->selected_pair.local == component->turn_candidate) {