On Mon, 2010-11-22 at 12:50 +0100, Duncan Mac-Vicar P. wrote:
On 11/20/2010 02:16 PM, David Woodhouse wrote:
This one probably isn't ready to apply as-is, but it's working for me right now. Problems include:
- it should have proper CMake magic to find and build against (and optionally *not* build against) libproxy.
- it probably shouldn't unconditionally subvert the old code which looks in /etc/sysconfig/proxy for per-url-scheme information.
- There's a memory leak when we return a proxy specified by libproxy.
That memory leak is probably fixed by this, FWIW: --- a/zypp/media/proxyinfo/ProxyInfoLibproxy.cc +++ b/zypp/media/proxyinfo/ProxyInfoLibproxy.cc @@ -73,8 +73,9 @@ namespace zypp { if (!result) return ""; - /* Yes, there's a memory leak here */ - return result; + std::string sresult = result; + free(result); + return sresult; } ProxyInfo::NoProxyIterator ProxyInfoLibproxy::noProxyBegin() const
David, thanks a lot for the patches
I have applied the first one locally as is. It only changes the API to do it more powerful, but the behavior is basically unchanged. (and thanks a lot for separating the patches in that logical way)
For the second one, I added a real check for libproxy, and compiled the files conditionally. If libproxy is found, then it is used, otherwise the default Sysconfig one is used. May be we should remove the Sysconfig one completely then.
I may have done that the other way round. If there's a hard-coded proxy (be it in /etc/sysconfig/proxy or $http_proxy) then we probably want to use that in *preference* to the automatically detected one from libproxy. The user should always be able to override.
However once I build, the testcases fail.
The following tests FAILED: 12 - Fetcher_test (Failed) 17 - MediaSetAccess_test (Failed) 24 - RepoInfo_test (Failed) 48 - MirrorList_test (Failed) Errors while running CTest
Hrm, that's interesting. Of course, you are now relying on libproxy to return the *correct* information about proxies. Is it? -- dwmw2 -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org