Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 95337 Details for
Bug 180921
[Proxy] Use system values for proxy settings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated UnixProxyProvider
180921_UnixProvider.txt (text/plain), 2.81 KB, created by
Francis Upton IV
on 2008-04-09 03:56:28 EDT
(
hide
)
Description:
Updated UnixProxyProvider
Filename:
MIME Type:
Creator:
Francis Upton IV
Created:
2008-04-09 03:56:28 EDT
Size:
2.81 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.net >Index: src/org/eclipse/core/internal/net/UnixProxyProvider.java >=================================================================== >RCS file: src/org/eclipse/core/internal/net/UnixProxyProvider.java >diff -N src/org/eclipse/core/internal/net/UnixProxyProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/core/internal/net/UnixProxyProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,95 @@ >+package org.eclipse.core.internal.net; >+ >+import java.net.URI; >+import java.net.URISyntaxException; >+ >+import org.eclipse.core.net.proxy.IProxyData; >+ >+public class UnixProxyProvider extends AbstractProxyProvider { >+ >+ static { >+ try { >+ System.loadLibrary("proxysupport"); //$NON-NLS-1$ >+ } catch (UnsatisfiedLinkError ex) { >+ // This will happen on systems that are missing Gnome libraries >+ Activator.logInfo("Error loading native proxysupport code", ex); //$NON-NLS-1$ >+ } >+ } >+ >+ public UnixProxyProvider() { >+ Activator.logInfo("linuxProxyProvider initialized", null); //$NON-NLS-1$ >+ } >+ >+ public IProxyData[] getProxyData(URI uri) { >+ String protocol = uri.getScheme(); >+ >+ ProxyData pd = getSystemProxyInfo(protocol); >+ >+ if (pd != null) { >+ IProxyData[] pds = new IProxyData[1]; >+ pds[0] = pd; >+ return pds; >+ } >+ >+ return new IProxyData[0]; >+ } >+ >+ protected String[] getNonProxiedHosts() { >+ try { >+ String[] npHosts = getGConfNonProxyHosts(); >+ if (npHosts != null && npHosts.length > 0) >+ return npHosts; >+ return getKdeNonProxyHosts(); >+ } catch (UnsatisfiedLinkError ex) { >+ // This has already been reported (the native code did not load) >+ } >+ return new String[] {}; >+ } >+ >+ // Returns null if something wrong or there is no proxy for the protocol >+ protected ProxyData getSystemProxyInfo(String protocol) { >+ ProxyData pd = null; >+ >+ // First try the environment variable which is a URL >+ String sysHttp = System.getenv(protocol.toLowerCase() + "_proxy"); //$NON-NLS-1$ >+ if (sysHttp != null) { >+ URI uri = null; >+ try { >+ uri = new URI(sysHttp); >+ } catch (URISyntaxException e) { >+ return null; >+ } >+ >+ pd = new ProxyData(protocol); >+ pd.setHost(uri.getHost()); >+ pd.setPort(uri.getPort()); >+ return pd; >+ } >+ >+ try { >+ // Then ask Gnome >+ pd = getGConfProxyInfo(protocol); >+ >+ if (pd != null) >+ return pd; >+ >+ // Then ask KDE >+ pd = getKdeProxyInfo(protocol); >+ if (pd != null) >+ return pd; >+ } catch (UnsatisfiedLinkError ex) { >+ // This has already been reported when the native code did not load >+ } >+ >+ return null; >+ } >+ >+ protected static native ProxyData getGConfProxyInfo(String protocol); >+ >+ protected static native String[] getGConfNonProxyHosts(); >+ >+ protected static native ProxyData getKdeProxyInfo(String protocol); >+ >+ protected static native String[] getKdeNonProxyHosts(); >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 180921
:
88543
|
90245
|
90246
|
91640
|
91641
|
91739
|
91958
|
91959
|
92027
|
92028
|
92325
|
92545
|
93183
|
93367
|
94535
|
94536
|
94712
|
94713
|
95020
|
95021
|
95030
|
95187
| 95337 |
95343
|
96393