1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

proxy: do not call setTcpNoDelay() but instead flush the stream

This commit is contained in:
Florian Schmaus 2019-11-18 19:37:10 +01:00
parent be2fc23f41
commit b6ad737aa4
2 changed files with 3 additions and 3 deletions

View file

@ -46,7 +46,6 @@ public class Socks4ProxySocketConnection implements ProxySocketConnection {
socket.connect(new InetSocketAddress(proxy_host, proxy_port), timeout); socket.connect(new InetSocketAddress(proxy_host, proxy_port), timeout);
InputStream in = socket.getInputStream(); InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream(); OutputStream out = socket.getOutputStream();
socket.setTcpNoDelay(true);
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int index = 0; int index = 0;
@ -88,6 +87,7 @@ public class Socks4ProxySocketConnection implements ProxySocketConnection {
} }
buf[index++] = 0; buf[index++] = 0;
out.write(buf, 0, index); out.write(buf, 0, index);
out.flush();
/* /*
The SOCKS server checks to see whether such a request should be granted The SOCKS server checks to see whether such a request should be granted

View file

@ -48,8 +48,6 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
InputStream in = socket.getInputStream(); InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream(); OutputStream out = socket.getOutputStream();
socket.setTcpNoDelay(true);
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int index = 0; int index = 0;
@ -81,6 +79,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
buf[index++] = 2; // USERNAME/PASSWORD buf[index++] = 2; // USERNAME/PASSWORD
out.write(buf, 0, index); out.write(buf, 0, index);
out.flush();
/* /*
The server selects from one of the methods given in METHODS, and The server selects from one of the methods given in METHODS, and
@ -205,6 +204,7 @@ public class Socks5ProxySocketConnection implements ProxySocketConnection {
buf[index++] = (byte) (port & 0xff); buf[index++] = (byte) (port & 0xff);
out.write(buf, 0, index); out.write(buf, 0, index);
out.flush();
/* /*
The SOCKS request information is sent by the client as soon as it has The SOCKS request information is sent by the client as soon as it has