cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: trouble with SSL URL

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sat, 5 Feb 2005 00:47:35 +0100 (CET)

On Fri, 4 Feb 2005, David Byron wrote:

> In the meantime, I was looking around to see if curl is handling this
> situation the best way it can. What I mean is, curl is looping forever
> calling poll(), and I wonder if curl should just be exiting with an error.
> I'm sure I'm showing my ignorance here, but so be it.

Why would it return an error? There should be one more byte to read.

> poll is setting the POLLERR bit in revents and Curl_select is returning
> CSELECT_ERR (which has a value of 0x04), but the code that calls Curl_select
> doesn't always check the return value properly from what I can tell. For
> example, AllowServerConnect in ftp.c checks for -1, and 0, but assumes
> anything else means we received. A little closer to code that's actually
> relevant here is Curl_select call in Curl_SSLConnect, and even more relevant
> are the calls in transfer.c. Should the call in Transfer() or
> Curl_readwrite check for CSELECT_ERR so that the loop in Transfer()
> finishes?

Your review and questioning bring up interesting issues.

If POLLERR is a critical condition on the connection, I guess Curl_select()
can just as well return -1 as that is detected better in the current source.

Or would it be a point for callers of this function to differ between poll()
returning failure to actually getting an error on the connection?

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-02-05