|
Lines 15-21
Link Here
|
| 15 |
import java.net.Socket; |
15 |
import java.net.Socket; |
| 16 |
import java.net.UnknownHostException; |
16 |
import java.net.UnknownHostException; |
| 17 |
import java.util.Enumeration; |
17 |
import java.util.Enumeration; |
| 18 |
import java.util.Map; |
|
|
| 19 |
|
18 |
|
| 20 |
import org.eclipse.core.runtime.*; |
19 |
import org.eclipse.core.runtime.*; |
| 21 |
import org.eclipse.jface.preference.IPreferenceStore; |
20 |
import org.eclipse.jface.preference.IPreferenceStore; |
|
Lines 396-427
Link Here
|
| 396 |
} |
395 |
} |
| 397 |
|
396 |
|
| 398 |
if (jschSession == null) { |
397 |
if (jschSession == null) { |
| 399 |
|
398 |
boolean useProxy = CVSProviderPlugin.getPlugin().isUseProxy(); |
| 400 |
boolean useProxy = store.getString(ISSHContants.KEY_PROXY).equals("true"); //$NON-NLS-1$ |
|
|
| 401 |
Proxy proxy = null; |
399 |
Proxy proxy = null; |
| 402 |
if (useProxy) { |
400 |
if (useProxy) { |
| 403 |
String _type = store.getString(ISSHContants.KEY_PROXY_TYPE); |
401 |
String _type = CVSProviderPlugin.getPlugin().getProxyType(); |
| 404 |
String _host = store.getString(ISSHContants.KEY_PROXY_HOST); |
402 |
String _host = CVSProviderPlugin.getPlugin().getProxyHost(); |
| 405 |
String _port = store.getString(ISSHContants.KEY_PROXY_PORT); |
403 |
String _port = CVSProviderPlugin.getPlugin().getProxyPort(); |
| 406 |
|
404 |
|
| 407 |
boolean useAuth = store.getString(ISSHContants.KEY_PROXY_AUTH).equals("true"); //$NON-NLS-1$ |
405 |
boolean useAuth = CVSProviderPlugin.getPlugin().isUseProxyAuth(); |
| 408 |
String _user = ""; //$NON-NLS-1$ |
406 |
String _user = ""; //$NON-NLS-1$ |
| 409 |
String _pass = ""; //$NON-NLS-1$ |
407 |
String _pass = ""; //$NON-NLS-1$ |
| 410 |
|
408 |
|
| 411 |
// Retrieve username and password from keyring. |
409 |
// Retrieve username and password from keyring. |
| 412 |
Map map = Platform.getAuthorizationInfo(CVSSSH2PreferencePage.FAKE_URL, "proxy", CVSSSH2PreferencePage.AUTH_SCHEME); //$NON-NLS-1$ |
410 |
if(useAuth){ |
| 413 |
if(map!=null){ |
411 |
_user=CVSProviderPlugin.getPlugin().getProxyUser(); |
| 414 |
_user=(String) map.get(ISSHContants.KEY_PROXY_USER); |
412 |
_pass=CVSProviderPlugin.getPlugin().getProxyPassword(); |
| 415 |
_pass=(String) map.get(ISSHContants.KEY_PROXY_PASS); |
413 |
} |
| 416 |
} |
|
|
| 417 |
|
414 |
|
| 418 |
String proxyhost = _host + ":" + _port; //$NON-NLS-1$ |
415 |
String proxyhost = _host + ":" + _port; //$NON-NLS-1$ |
| 419 |
if (_type.equals(ISSHContants.HTTP)) { |
416 |
if (_type.equals(CVSProviderPlugin.PROXY_TYPE_HTTP)) { |
| 420 |
proxy = new ProxyHTTP(proxyhost); |
417 |
proxy = new ProxyHTTP(proxyhost); |
| 421 |
if (useAuth) { |
418 |
if (useAuth) { |
| 422 |
((ProxyHTTP) proxy).setUserPasswd(_user, _pass); |
419 |
((ProxyHTTP) proxy).setUserPasswd(_user, _pass); |
| 423 |
} |
420 |
} |
| 424 |
} else if (_type.equals(ISSHContants.SOCKS5)) { |
421 |
} else if (_type.equals(CVSProviderPlugin.PROXY_TYPE_SOCKS5)) { |
| 425 |
proxy = new ProxySOCKS5(proxyhost); |
422 |
proxy = new ProxySOCKS5(proxyhost); |
| 426 |
if (useAuth) { |
423 |
if (useAuth) { |
| 427 |
((ProxySOCKS5) proxy).setUserPasswd(_user, _pass); |
424 |
((ProxySOCKS5) proxy).setUserPasswd(_user, _pass); |