mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Refactor getSocks5Proxy method: Return early, make flow more clear
This commit is contained in:
parent
3a2e4f1d69
commit
7f85fd9b7d
@ -115,18 +115,23 @@ public class HttpClientImpl implements HttpClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private Socks5Proxy getSocks5Proxy(Socks5ProxyProvider socks5ProxyProvider) {
|
private Socks5Proxy getSocks5Proxy(Socks5ProxyProvider socks5ProxyProvider) {
|
||||||
Socks5Proxy socks5Proxy = null;
|
if (socks5ProxyProvider == null) {
|
||||||
if (socks5ProxyProvider != null) {
|
return null;
|
||||||
// We use the custom socks5ProxyHttp. If not set we request socks5ProxyProvider.getSocks5ProxyBtc()
|
|
||||||
// which delivers the btc proxy if set, otherwise the internal proxy.
|
|
||||||
socks5Proxy = socks5ProxyProvider.getSocks5ProxyHttp();
|
|
||||||
if (socks5Proxy == null)
|
|
||||||
socks5Proxy = socks5ProxyProvider.getSocks5Proxy();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We use the custom socks5ProxyHttp.
|
||||||
|
Socks5Proxy socks5Proxy = socks5ProxyProvider.getSocks5ProxyHttp();
|
||||||
|
if (socks5Proxy != null) {
|
||||||
return socks5Proxy;
|
return socks5Proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If not set we request socks5ProxyProvider.getSocks5Proxy()
|
||||||
|
// which delivers the btc proxy if set, otherwise the internal proxy.
|
||||||
|
return socks5ProxyProvider.getSocks5Proxy();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make an HTTP Get request directly (not routed over socks5 proxy).
|
* Make an HTTP Get request directly (not routed over socks5 proxy).
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user