removed unnecessary code, bug fix
This commit is contained in:
parent
7623cd154b
commit
a5d62c5385
@ -22,19 +22,23 @@ abstract class ProxySetup {
|
||||
ProxyConnection proxyConnection;
|
||||
ProxyAuthenticator proxyLogin;
|
||||
|
||||
|
||||
if (settings.isProxyEnabled()) {
|
||||
proxyConnection = new ProxyConnection(settings);
|
||||
if (settings.isProxyAuthSet()) {
|
||||
proxyLogin = new ProxyAuthenticator(settings);
|
||||
} else {
|
||||
proxyLogin = new ProxyAuthenticator();
|
||||
}
|
||||
} else {
|
||||
proxyConnection = new ProxyConnection();
|
||||
}
|
||||
if (settings.isProxyAuthSet()) {
|
||||
proxyLogin = new ProxyAuthenticator(settings);
|
||||
} else {
|
||||
proxyLogin = new ProxyAuthenticator();
|
||||
}
|
||||
ProxySelector.setDefault(proxyConnection);
|
||||
Authenticator.setDefault(proxyLogin);
|
||||
try {
|
||||
ProxySelector.setDefault(proxyConnection);
|
||||
Authenticator.setDefault(proxyLogin);
|
||||
} catch (SecurityException sErr) {
|
||||
sErr.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -380,9 +380,9 @@ public class GlobalSettings {
|
||||
* @return proxy port integer
|
||||
*/
|
||||
public int getProxyPortNumber() {
|
||||
if (proxyPort.isEmpty() || proxyPort.length() > 5)
|
||||
return 0;
|
||||
return Integer.parseInt(proxyPort);
|
||||
if (isProxyEnabled && !proxyPort.isEmpty() && proxyPort.length() < 6)
|
||||
return Integer.parseInt(proxyPort);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user