cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Less blocking during proxy CONNECT

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 9 Feb 2007 23:14:27 +0100 (CET)

On Fri, 9 Feb 2007, Adam D. Moss wrote:

Thanks for your efforts in improving libcurl!

> Here's the same patch updated for libcurl 7.16.1.

(the patch requires a minor manual edit to apply to CVS due to the recent
millisecond timeout patch)

I know you said it was a first rough version, but it had weird indents and it
gave me several warnings, for example:

http.c:1233:7: warning: C++ style comments are not allowed in ISO C90
http.c:1233:7: warning: (this will be reported only once per input file)
http.c: In function 'Curl_proxyCONNECT':
http.c:1224: warning: ISO C90 forbids mixed declarations and code
http.c:1118: warning: unused variable 'ptr'

I'm quite okay with your approach in general, as it does offer a less blocking
connect procedure, even if I think that perhaps you could extend your approach
and make the entire reading of the CONNECT response done in the same spirit
without any block.

The main flaw that I couldn't see any fix for, is for the easy interface case
when Curl_proxyCONNECT() returns due to a slow connect and there's no code
that attempts to call it again to finish the job. Perhaps you could simply
check if the easy interface is used (data->state.used_interface ==
Curl_if_easy) and if so let the Curl_select() call actually do a regular wait
for action with the timeout value you already have in 'check' (lib/http.c
around line 1232).

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