Merge branch '4.3'

This commit is contained in:
Florian Schmaus 2019-03-24 00:16:24 +01:00
commit a23adfab6e
2 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class HTTPProxySocketConnection implements ProxySocketConnection {
proxyLine = "\r\nProxy-Authorization: Basic " + Base64.encode(username + ":" + password); proxyLine = "\r\nProxy-Authorization: Basic " + Base64.encode(username + ":" + password);
} }
socket.getOutputStream().write((hostport + " HTTP/1.1\r\nHost: " socket.getOutputStream().write((hostport + " HTTP/1.1\r\nHost: "
+ hostport + proxyLine + "\r\n\r\n").getBytes("UTF-8")); + host + ":" + port + proxyLine + "\r\n\r\n").getBytes("UTF-8"));
InputStream in = socket.getInputStream(); InputStream in = socket.getInputStream();
StringBuilder got = new StringBuilder(100); StringBuilder got = new StringBuilder(100);
@ -115,7 +115,8 @@ class HTTPProxySocketConnection implements ProxySocketConnection {
int code = Integer.parseInt(m.group(1)); int code = Integer.parseInt(m.group(1));
if (code != HttpURLConnection.HTTP_OK) { if (code != HttpURLConnection.HTTP_OK) {
throw new ProxyException(ProxyInfo.ProxyType.HTTP); throw new ProxyException(ProxyInfo.ProxyType.HTTP,
"Error code in proxy response: " + code);
} }
} }

View File

@ -609,6 +609,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
proxyInfo.getProxySocketConnection().connect(socket, host, port, timeout); proxyInfo.getProxySocketConnection().connect(socket, host, port, timeout);
} catch (IOException e) { } catch (IOException e) {
hostAddress.setException(e); hostAddress.setException(e);
failedAddresses.add(hostAddress);
continue; continue;
} }
LOGGER.finer("Established TCP connection to " + hostAndPort); LOGGER.finer("Established TCP connection to " + hostAndPort);