curl-library
RE: Invalid proxy settings
Date: Mon, 13 Feb 2012 13:26:43 +0100 (CET)
On Mon, 13 Feb 2012, Chandrakant Bagul -ERS, HCL Tech wrote:
>> Yes, right. I was being stupid - setopt() basically only copies the string
>> and does no parsing whatsoever. I could repeat your problem and I've now
>> pushed a fix for this with an associated test case (1329). Thanks for
>> reporting!
>
> Could you please explain the provided fix & which different invalid proxy
> settings are covered/considered in the LibCurl.
The primary flaw I fixed:
libcurl could end up stripping off the left part of a proxy name (like
everything up to a slash) and only consider the remainder (the right part) as
the actual name. If the remainder happened to be zero bytes long it would then
be treated as no proxy at all.
In your case, it turned out libcurl could connect to something (else?) without
a proxy and that is what happened.
Now with my fix applied, libcurl will not allow a zero length proxy name to go
through but will return error instead. If the proxy name is longer than zero
bytes, then it is a host name that will be resolved or used "like normal" and
if that is bad then the resolving of it should fail just like before.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2012-02-13