Mailinglist Archive: zypp-devel (27 mails)

< Previous Next >
Re: [zypp-devel] [PATCH 2/2] Add support for using libproxy to find proxies
  • From: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
  • Date: Mon, 20 Dec 2010 17:32:24 +0000
  • Message-id: <1292866344.2577.15.camel@xxxxxxxxxxxxxxxxxxxxx>
On Mon, 2010-11-22 at 12:50 +0100, Duncan Mac-Vicar P. wrote:
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.

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

I believe you established that this was a problem with your local
libproxy implementation? Certainly the tests are passing fine for me.

Can we merge the code from the libproxy branch into master? Probably
worth adding this patch, while you're at it...

commit d1cb8915d571fe6d9ecf41db60c7184d6ede3e9c
Author: David Woodhouse <David.Woodhouse@xxxxxxxxx>
Date: Mon Dec 20 17:26:53 2010 +0000

Fix libproxy string handling

diff --git a/zypp/media/proxyinfo/ProxyInfoLibproxy.cc
b/zypp/media/proxyinfo/ProxyInfoLibproxy.cc
index 9baaa22..3b223ac 100644
--- a/zypp/media/proxyinfo/ProxyInfoLibproxy.cc
+++ b/zypp/media/proxyinfo/ProxyInfoLibproxy.cc
@@ -59,23 +59,17 @@ namespace zypp {

/* cURL can only handle HTTP proxies, not SOCKS. And can only handle
one. So look through the list and find an appropriate one. */
- char *result = NULL;
+ std::string result;

for (int i = 0; proxies[i]; i++) {
- if (!result &&
- !strncmp(proxies[i], "http://";, 7))
+ if (result.empty() && !strncmp(proxies[i], "http://";, 7))
result = proxies[i];
- else
- free(proxies[i]);
+
+ free(proxies[i]);
}
free(proxies);

- if (!result)
- return "";
-
- std::string sresult = result;
- free(result);
- return sresult;
+ return result;
}

ProxyInfo::NoProxyIterator ProxyInfoLibproxy::noProxyBegin() const

--
dwmw2

--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages