[PATCH] Fix bug in "manual" GNOME proxy handling

Michael Ellerman michael at ellerman.id.au
Thu Mar 6 01:18:54 EST 2008


On Wed, 2008-03-05 at 04:32 -0500, Mark Doliner wrote:
> On Wed, 05 Mar 2008 14:05:45 +1100, Michael Ellerman wrote
> > In libpurple/proxy.c, purple_gnome_proxy_get_info() uses gconftool to
> > get the GNOME proxy settings. It explicitly looks for proxy type =
> > "none", in which case no proxy is used, and also proxy type = 
> > "manual" in which case the global pidgin proxy is used.
> > 
> > However the check for "manual" is missing a ! on the strcmp(), so it
> > incorrectly falls through. The following code assumes it's using a HTTP
> > proxy, which may not be the case when "manual" is specified. This causes
> > pidgin to pop up a warning about the proxy host/port being invalid.
> > 
> > Index: pidgin-2.2.1/libpurple/proxy.c
> > ===================================================================
> > --- pidgin-2.2.1.orig/libpurple/proxy.c
> > +++ pidgin-2.2.1/libpurple/proxy.c
> > @@ -225,7 +225,7 @@ purple_gnome_proxy_get_info(void)
> >  			info.type = PURPLE_PROXY_NONE;
> >  			g_free(tmp);
> >  			return &info;
> > -		} else if (strcmp(tmp, "manual\n")) {
> > +		} else if (!strcmp(tmp, "manual\n")) {
> >  			g_free(tmp);
> >  			return purple_global_proxy_get_info();
> >  		}
> 
> I don't think this change is correct.

I disagree :)

> "manual" means that the user has entered a proxy into their Gnome Proxy 
> Preferences window.

Yep.

>  This check says, "if proxy type is anything other than manual than bail
>  out and use the global proxy info."

That's what the old code did, that's clearly wrong - what if I used
automatic proxy configuration, why should gaim ignore it?

The code below the check assumes we're using a HTTP proxy, which is not
necessarily true for "manual", so it makes sense that if the type is
"manual" gaim should just give up and use the global gaim proxy.

> What error are you seeing, exactly?  Is your Gnome Proxy Preference set to
> "manual" but you don't have an HTTP proxy hostname set?

I get a pop up telling me that my proxy hostname or port is incorrect.

And yes it's set to "manual" and I have no HTTP proxy - I don't use one,
I have a SOCKS proxy.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://pidgin.im/pipermail/devel/attachments/20080306/36e3319f/attachment.sig>


More information about the Devel mailing list