mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-29 17:52:06 +01:00
proxy: do not call setTcpNoDelay() but instead flush the stream
This commit is contained in:
parent
7afd1fdf46
commit
14cc0c1e41
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue