cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: handling ssl errors

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 2 Apr 2002 11:32:17 +0200 (MET DST)

On Thu, 28 Mar 2002, Clarence Gardner wrote:

> The following code appears in Curl_read() in sendf.c. As I recall from my
> days of working with ssl, there are about 1000006 errors that can be
> returned. I had a program get into an infinite loop in this code because it
> was getting error 5 (whatever that is). I assume that, if these are the
> only errors that can be handled, any other should cause an error return
> from Curl_read.

Thanks, that piece of code was rather naive and I figure that this patch
should be applied:

diff -u -r1.46 sendf.c
--- sendf.c 19 Mar 2002 07:54:55 -0000 1.46
+++ sendf.c 2 Apr 2002 09:30:27 -0000
@@ -347,6 +347,9 @@
       case SSL_ERROR_WANT_WRITE:
         /* if there's data pending, then we re-invoke SSL_read() */
         break;
+ default:
+ failf(conn->data, "SSL read error: %d", err);
+ return CURLE_READ_ERROR;
       }
     } while(loop);
     if(loop && SSL_pending(conn->ssl.handle))

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-02