aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module
diff options
context:
space:
mode:
authorhrxi <hrrrxi@gmail.com>2019-08-24 13:30:23 +0200
committerhrxi <hrrrxi@gmail.com>2019-08-24 13:32:22 +0200
commit6083f446b47e258e0381c0c22755dbfa881c7df7 (patch)
tree612692bd0e903688d23610882c9ef0c3cbd93320 /xmpp-vala/src/module
parent34d7b5f515d120a80b8730dadb0a66326b8d0c4a (diff)
downloaddino-6083f446b47e258e0381c0c22755dbfa881c7df7.tar.gz
dino-6083f446b47e258e0381c0c22755dbfa881c7df7.zip
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).
Diffstat (limited to 'xmpp-vala/src/module')
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle.vala2
-rw-r--r--xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala5
2 files changed, 4 insertions, 3 deletions
diff --git a/xmpp-vala/src/module/xep/0166_jingle.vala b/xmpp-vala/src/module/xep/0166_jingle.vala
index e0a96cc6..d6dbcd9e 100644
--- a/xmpp-vala/src/module/xep/0166_jingle.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle.vala
@@ -720,7 +720,7 @@ public class Session {
.put_node(new StanzaNode.build("text", NS_URI)
.put_node(new StanzaNode.text(error.message))
);
- terminate(reason, "transport error: $(error.message)");
+ terminate(reason, @"transport error: $(error.message)");
}
public void on_connection_close() {
if (terminate_on_connection_close) {
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;
}
}