From 6083f446b47e258e0381c0c22755dbfa881c7df7 Mon Sep 17 00:00:00 2001 From: hrxi Date: Sat, 24 Aug 2019 13:30:23 +0200 Subject: Fix candidate selection for equal priority XEP-0260 states that the candidate selected (offered) by the initiator wins, not the one that was chosen by the initiator (i.e. offered by the responder). --- xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala') diff --git a/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala b/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala index 79c62d68..c17dc0b3 100644 --- a/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala +++ b/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala @@ -332,8 +332,9 @@ class Parameters : Jingle.TransportParameters, Object { } else if (local.priority > remote.priority) { remote_wins = false; } else { - // equal priority -> XEP-0260 says that the initiator wins - remote_wins = role != Jingle.Role.INITIATOR; + // equal priority -> XEP-0260 says that the candidate offered + // by the initiator wins, so the one that the remote chose + remote_wins = role == Jingle.Role.INITIATOR; } } -- cgit v1.2.3-54-g00ecf