It seems that if I set the underlying socket to be non-blocking, then the
SSL wrapper is also non-blocking.  However it seems that SSL_get_error()
exhibits strange behaviour to me.  It alternately returns SSL_ERROR_NONE
and SSL_ERROR_SYSCALL even when there is nothing to read on the socket.
What is causing this?

--Douglas


> 
>         All processing happens with the socket in NON-BLOCKING mode.
> 
>           if (SS->sslmode) {
>             r = SSL_write(SS->ssl, p, len);
>             e = errno; /* FIXME: Some SSL function ??? */
>             if (r < 0) {
>               e = SSL_get_error(SS->ssl, r);
>               if (e == SSL_ERROR_WANT_WRITE) {
>                 /* Right, so we want to wait a bit, and retry.. */
>                 e = EAGAIN;
>               } else {
>                 /* XXX: Err... What ??? */
>                 e = ETIMEDOUT; /* not precisely.. */
>                 gotalarm = 1;  /* Well, sort of.. */
>                 break;
>               }
>             }
>           } else
>                 ...
> 
> 
>         if (SS->sslmode) {
>           r = SSL_read(SS->ssl, buf, spc);
>           e = SSL_get_error(SS->ssl, r);
>           if (e == SSL_ERROR_WANT_READ) {
>             e = EAGAIN;
>           } else
>             e = EINTR;
>         } else
>                 ...
> 
> 
> 
> > Many thanks for any help.
> > --Douglas Lee
> 
> /Matti Aarnio <[EMAIL PROTECTED]>
> 
> Cheers,
> --Douglas
> 
> ---------------------------------------------------------------
> |Douglas Lee                     |Phone: (02)9206 3422        | 
> |                                |Fax  : (02)9281 1301        |
> |Telstra IN and                  |Add : Lev 2 175 Liverpool St|
> |Internetworking Design (TINID)  |      Sydney                |
> |                                |                            |
> |Email:[EMAIL PROTECTED] |                            |
> ---------------------------------------------------------------
> 
> 
> 


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to