From 7c7910729acbaa81593eeedcc27424c1b6648f4e Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 30 Sep 2021 15:47:48 +0200 Subject: Send SOCKS error and close connection when SOCKS5 handshake fails --- xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmpp-vala/src/module/xep') 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 47c243e8..32ba8bb9 100644 --- a/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala +++ b/xmpp-vala/src/module/xep/0260_jingle_socks5_bytestreams.vala @@ -327,6 +327,10 @@ class LocalListener { connections[cid] = conn; } } catch (Error e) { + warning("Jingle SOCKS5 bytestream establish error cid %s: %s", cid, e.message); + // Send a "general SOCKS server failure" (0x01) + yield conn.output_stream.write_all_async({0x05, 0x01}, GLib.Priority.DEFAULT, null, out written); + yield conn.output_stream.close_async(); } } -- cgit v1.2.3-70-g09d2