From e1c98a0fd94d0536c231ce79c2af63d891bf4c16 Mon Sep 17 00:00:00 2001 From: hrxi Date: Tue, 6 Aug 2019 16:45:48 +0200 Subject: Forgot to add outgoing Jingle SOCKS5 transfer --- xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'xmpp-vala/src/module') 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 abe5e0a9..78f47cfb 100644 --- a/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala +++ b/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala @@ -159,6 +159,7 @@ class Parameters : Jingle.TransportParameters, Object { public Gee.List local_candidates = new ArrayList(); public Gee.List remote_candidates = new ArrayList(); + Jid local_full_jid; Jid peer_full_jid; bool remote_sent_selected_candidate = false; @@ -182,6 +183,7 @@ class Parameters : Jingle.TransportParameters, Object { this.local_dstaddr = calculate_dstaddr(sid, local_full_jid, peer_full_jid); this.remote_dstaddr = remote_dstaddr ?? calculate_dstaddr(sid, peer_full_jid, local_full_jid); + this.local_full_jid = local_full_jid; this.peer_full_jid = peer_full_jid; } public Parameters.create(Jid local_full_jid, Jid peer_full_jid, string sid) { @@ -224,7 +226,12 @@ class Parameters : Jingle.TransportParameters, Object { return transport; } public void on_transport_accept(StanzaNode transport) throws Jingle.IqError { - throw new Jingle.IqError.BAD_REQUEST("blurb"); + Parameters other = Parameters.parse(local_full_jid, peer_full_jid, transport); + if (other.sid != sid) { + throw new Jingle.IqError.BAD_REQUEST("invalid sid"); + } + remote_candidates = other.remote_candidates; + remote_dstaddr = other.remote_dstaddr; } public void on_transport_info(StanzaNode transport) throws Jingle.IqError { StanzaNode? candidate_error = transport.get_subnode("candidate-error", NS_URI); -- cgit v1.2.3-70-g09d2