gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [sr #107464] Secure Connections on AIX using non blocking socket


From: Bjørn Christensen
Subject: RE: [sr #107464] Secure Connections on AIX using non blocking socket
Date: Thu, 26 Aug 2010 13:31:52 +0200

Hello Nikos

From www.opengroup.org

Upon successful completion, recv() shall return the length of the message in 
bytes. If no messages are available to be received and the peer has performed 
an orderly shutdown, recv() shall return 0. Otherwise, -1 shall be returned and 
errno set to indicate the error

This means that the AIX have a problem.

The specification says that errno should be set when returning -1 from recv. 
This means that the error can not be fatal.

What happens if I let _gnutls_read return 0 in this case??

Returning GNUTLS_E_AGAIN makes the handshake complete


/bhc




-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Nikos Mavrogiannopoulos
Sent: 26. august 2010 11:53
To: Bjørn Christensen
Cc: address@hidden
Subject: Re: [sr #107464] Secure Connections on AIX using non blocking socket

2010/8/26 Bjørn Christensen <address@hidden>:
> Hello Nikos!
>
> The code in _gnutls_read fires a gnutls_assert if  recv return -1 and the 
> errno is different from EAGAIN and EINTR. _gnutls_read function returns 
> GNUTLS_E_PULL_ERROR.
> I think the assertion leads to the HandShake being terminated.
> In the _gnutls_read when recv returns -1 and no errno it is treated as a 
> fatal error assert and GNUTLS_E_PULL_ERROR.
> Mayby is would be enough to not return the GNUTLS_E_PULL_ERROR if the errno 
> is zero?

This doesn't sound correct. It will break systems where recv() returns
-1 for a fatal error without errno.

regards,
Nikos

reply via email to

[Prev in Thread] Current Thread [Next in Thread]