cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: trouble with SSL URL

From: David Byron <DByron_at_everdreamcorp.com>
Date: Fri, 4 Feb 2005 13:19:07 -0800

On Fri, 4 Feb 2005, Daniel Stenberg wrote:

> The best thing to do would be to write a completely new C
> program that TCP connects to a given host, SSL-negotiates,
> sends a proper HTTP request, and then downloads the resúlt
> using a buffer that is 16383 bytes big.
>
> If such a program shows the same sympthoms, I bet the
> OpenSSL devs would love to get such a source in a bug
> report.
>
> That will however require quite some work. The short-cut
> would probably be to write up a detailed description of what
> curl does and send that in a bug report instead. Not as
> good, but possibly almost as useful. I could help out with
> this (too).

These are good ideas. I'll take a crack at the new C program and see where I get. I think you'll be better at trying to describe what curl does. For what it's worth, we have a program here called sslget that came with a commercial monitoring tool, and it can get this special length file just fine.

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.

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?

-DB
Received on 2005-02-04