[vlc-devel] [PATCH] Add support for libproxy to the access module http. Libproxy reads proxy settings from kde, gnome, networkmanager, environment

Dominique Leuenberger dominique at leuenberger.net
Sun Jun 15 13:49:03 CEST 2008


On Sun, 15 Jun 2008 13:01:01 +0200
Pierre d'Herbemont <pdherbemont at free.fr> wrote:

> 
> On Jun 15, 2008, at 11:25 AM, Dominique Leuenberger wrote:
> 
> > +#ifdef HAVE_PROXY_H
> > +    else
> > +    {
> > +	pxProxyFactory *pf = px_proxy_factory_new();
> >
> We tend not to use tab, but 4 spaces for indentation... Could you
> fix that too?
> 

Oh sorry for that... put spaces all over now.

> > +	char *buf;
> > +	int i;
> > +	i=asprintf(&buf, "%s://%s", p_access->psz_access,
> > p_access- 
> > >psz_path);
> 
> As Rémi noted, you need to check the return value of asprintf.

Missed that one... if I understand correct, asprintf returns -1 in case
of failure or >= 0 in case of success... added a check for this.

> 
> > +	msg_Dbg(p_access, "asking libproxy about url '%s'", buf);
> > +	char **proxies = px_proxy_factory_get_proxies(pf, buf);
> > +	if (proxies[0])
> > +	{
> > +	    msg_Dbg(p_access, "libproxy suggest to use '%s'",
> > proxies[0]);
> > +	    if(proxies[0] != "direct://")
> 
> As Rémi noted this won't give the expected result. Use strcmp.
> 

Tried to implement something alike... hope this is better.


> Thanks for keeping improving your patch.

It's me that have to say 'thanks' here.. I'm really sorry for wasting
so much of all your time. Trying to get used to programming simple
things again... learned it in school 10 years ago, but we only used
Turbo Pascal and Visual Basic... so thank you for bearing with me!

Dominique
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-libproxy-to-the-access-module-http.patch
Type: text/x-patch
Size: 3156 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080615/b7f8fade/attachment.bin>


More information about the vlc-devel mailing list