diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 16:50:56 +0200 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 16:50:56 +0200 |
commit | 25eb08ae486bb7342632478c4f7c818f178cad76 (patch) | |
tree | d6c9973ec026c2fa02867ba7e2a0b97ae80e99a3 /src/main/java/de/pixart/messenger/utils | |
parent | c488121d3822aa72ec22a070121a04bbcfd0c092 (diff) |
set shorter timeouts when using direct candidates
Diffstat (limited to 'src/main/java/de/pixart/messenger/utils')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/SocksSocketFactory.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/SocksSocketFactory.java b/src/main/java/de/pixart/messenger/utils/SocksSocketFactory.java index 365f77c6c..8a251a6a0 100644 --- a/src/main/java/de/pixart/messenger/utils/SocksSocketFactory.java +++ b/src/main/java/de/pixart/messenger/utils/SocksSocketFactory.java @@ -13,8 +13,8 @@ import de.pixart.messenger.Config; public class SocksSocketFactory { public static void createSocksConnection(Socket socket, String destination, int port) throws IOException { - InputStream proxyIs = socket.getInputStream(); - OutputStream proxyOs = socket.getOutputStream(); + final InputStream proxyIs = socket.getInputStream(); + final OutputStream proxyOs = socket.getOutputStream(); proxyOs.write(new byte[]{0x05, 0x01, 0x00}); byte[] response = new byte[2]; proxyIs.read(response); @@ -22,7 +22,7 @@ public class SocksSocketFactory { throw new SocksConnectionException("Socks 5 handshake failed"); } byte[] dest = destination.getBytes(); - ByteBuffer request = ByteBuffer.allocate(7 + dest.length); + final ByteBuffer request = ByteBuffer.allocate(7 + dest.length); request.put(new byte[]{0x05, 0x01, 0x00, 0x03}); request.put((byte) dest.length); request.put(dest); |