cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH 2/2] throw CURLE_SSL_CERTPROBLEM in case peer rejects a cert

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Fri, 2 Apr 2010 15:42:13 +0200

On Fri April 2 2010 15:33:08 Kamil Dudka wrote:
> On Fri April 2 2010 15:06:04 Kamil Dudka wrote:
> > On Sun March 21 2010 00:47:27 Daniel Stenberg wrote:
> > > Yeah, that makes perfect sense - this will improve what error codes we
> > > return for SSL-related errors and that can only be good for users. We
> > > should also make sure that we update all comments etc in the code. I
> > > just went over this rather quickly to show you my idea, I didn't test
> > > this either yet.
> >
> > It may be silly question, but why does Curl_ssl_send() not consider
> > EWOULDBLOCK at all?
>
> Poking around, I can see it does. When Curl_write() returns zero, it means
> EWOULDBLOCK, though it's not anywhere mentioned. Am I on the right track?

Oops, I mixed it up again.

In Curl_gtls_send() is:

    if(rc == GNUTLS_E_AGAIN)
      return 0; /* EWOULDBLOCK equivalent */

In Curl_write() is:

  bytes_written = Curl_ssl_send(conn, num, mem, len);
  ...
  *written = bytes_written;
  retcode = (-1 != bytes_written)?CURLE_OK:CURLE_SEND_ERROR;

So that CURLE_OK in combination with (*written == 0) means EWOULDBLOCK, am I
right?

> > Kamil
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-02