Send SOCKS error and close connection when SOCKS5 handshake fails

This commit is contained in:
fiaxh 2021-09-30 15:47:48 +02:00
parent 6ca47bf795
commit 7c7910729a
1 changed files with 4 additions and 0 deletions

View File

@ -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();
}
}