cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [ANN] libproxy 0.2

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 21 Dec 2007 16:12:13 +0100 (CET)

On Fri, 21 Dec 2007, Nathaniel McCallum wrote:

>>> You should be able to do this without performance penalty as long as
>>> you keep the pxProxyFactory object around.
>>
>> ... which isn't possible within libcurl.
>
> You can't perform more than one request with a single libcurl handle? I
> would suspect pxProxyFactory lifetime would be the same as a libcurl handle.

No, that's not what I meant.

First, libcurl is thread-safe and many applications use a large amount of
simultanoues threads that do requests. That's why we can't even consider
adding support for this until it is thread-safe. I'm even assuming the
non-thread-safe part will make many applications not able to use it either.
(I also realize this can and should be fixed.)

But more importantly what I was trying to say was that when doing a
init-a-handle, do-a-request, kill-the-handle code with libcurl, there's no
data left in between the requests so when an application does that "chain"
repeatedly we'll have to detect the proxy setting every time and we'd have to
load the PAC again every time. Unless the client is modified of course...

Sure, libcurl encourages applications to re-use the easy handles as far as
possible so for most uses it shouldn't have to re-scan for proxy config, but
we need to consider the worst-case scenarios if we're thinking of introducing
this approach by default. Do note that libcurl is in general using options as
opt-in, doing the bare minimum by default and basically always asking the user
to select the more fancy behaviour which also kind of implies that automatic
proxy detection would need to be enabled explicitly to follow the libcurl API
tradition.

>> For PAC you need to check for every single new URL the app wants to use.
>> Doesn't WPAD also allow different proxies for different URLs/protocols?
>
> Yes, but this is all done client side after fetching the PAC, so there is
> minimal performance hit.

Only if the client side can cache the PAC file (or byte code of it or
whatever), which it isn't always doing with libcurl.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-12-21