Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323378

Summary: [Net] Native bypass for "*.eclipse.org" does not work
Product: [Eclipse Project] Platform Reporter: Wojciech Galanciak <wojciech.galanciak>
Component: TeamAssignee: Szymon Brandys <Szymon.Brandys>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: deux_d_tension, kazm, krzysztof.daniel, pawel.pogorzelski1, Szymon.Brandys
Version: 3.6Flags: Szymon.Brandys: review+
Target Milestone: 3.7 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed solution
none
patch only for Windows
none
improved patch for Windows
none
patch for Windows + updated test Szymon.Brandys: iplog+

Description Wojciech Galanciak CLA 2010-08-23 07:08:11 EDT
Steps to reporduce:
1. Set *.eclipse.org to your proxy bypasses in IE
2. Set native proxy provider in Eclipse
3. Try to fetch code from CVS from dev.eclipse.org => it goes through the proxy but it should not.
4. Change from *.eclipse.org to dev.eclipse.org => it doesn't go through the proxy (works as expected).

For manual settings (for *.eclipse.org and dev.eclipse.org bypasses) it works correctly. It works also for native settings like dev.eclipse.*.
Comment 1 Wojciech Galanciak CLA 2010-08-24 07:54:24 EDT
Created attachment 177306 [details]
proposed solution

It looks like there is a problem in native code for Windows. I have uploaded possible solution. It uses StringMatcher to check if host matches to any bypass pattern instead of using String.equals(). It does not solve problem in native code but avoids unnecessary native call to getProxyData() for bypasses with * (if host matches to pattern).
Comment 2 Pawel Pogorzelski CLA 2010-08-24 08:31:41 EDT
If there's a problem on Windows platform only the fix should affect only WindowsProxyProvider not AbstractProxyProvider I guess.
Comment 3 Wojciech Galanciak CLA 2010-08-24 09:25:46 EDT
Yes, you are right but in the other hand, the whole block:
String[] nonProxyHosts = getNonProxiedHosts();
		
if (nonProxyHosts != null) {
	String host = uri.getHost();
	for (int npIndex = 0; npIndex < nonProxyHosts.length; npIndex++) {
		if (host.equals(nonProxyHosts[npIndex])) {
			return new IProxyData[0];
		}
	}
}
is unnecessary, at least for Windows, cause Windows's provider for method getProxyData checks also system bypasses.
Comment 4 Szymon Brandys CLA 2010-09-15 10:25:31 EDT
(In reply to comment #3)
> is unnecessary, at least for Windows, cause Windows's provider for method
> getProxyData checks also system bypasses.

This is not completely true. It seems that it respects bypasses like dev.eclipse.*, but ignores *.eclipse.org. Wojtek told me that tools like IE respect both forms so I assume both are correct. Thus, if it is a Win problem, we should check bypasses on our side.
Comment 5 Wojciech Galanciak CLA 2010-09-15 10:55:58 EDT
Created attachment 178943 [details]
patch only for Windows

Here is a patch which fixes the problem only on Windows side.
Anyway, I will investigate the problem mentioned in comment 3 and open a new bug if necessary.
Comment 6 Wojciech Galanciak CLA 2010-09-15 11:38:55 EDT
Created attachment 178955 [details]
improved patch for Windows

Patch with StringMatcher to support e.g. www.*.mypage.com
Comment 7 Szymon Brandys CLA 2010-09-15 12:20:43 EDT
The latest patch looks good. Wojtek, please make sure that the patch does not introduce any regression and I will commit it at the beginning of M3.
Comment 8 Wojciech Galanciak CLA 2010-09-16 10:21:07 EDT
Created attachment 179035 [details]
patch for Windows + updated test

There is no regression problems. Additionally, I have extended bypass test for Windows with some new patterns.
Comment 9 Szymon Brandys CLA 2010-09-16 10:37:29 EDT
I already approved the previous patch, if you want me to review the latest one you should reset the review flag.
Comment 10 Szymon Brandys CLA 2010-09-20 06:09:11 EDT
Checked in to HEAD.
Comment 11 S Lequeux CLA 2011-03-21 09:38:35 EDT
This bug is targeted for 3.7 M3.
Is it planned to include it in an update version for 3.6 ? Or is there a way to include the patch to an existing v3.6 installation ?