return value of gnutls_record_check_pending
Nikos Mavrogiannopoulos
nmav at gnutls.org
Tue Jun 28 22:35:08 CEST 2011
On Tue, Jun 28, 2011 at 7:59 PM, Michael Cronenworth <mike at cchtml.com> wrote:
> Hi all,
>
> My understanding of the man page for the function
> gnutls_record_check_pending() says that it should return the number of bytes
> waiting to be read, or 0 bytes if nothing is to be read.
The description of the function mentions "in the gnutls buffers". I believe this
clarifies the discrepancy you see in the example below. select()
checks the kernel
buffers.
regards,
Nikos
> example pseudo-code:
> while( 1 ) {
> ret = select( fd );
> // ret == 1
> ret = gnutls_record_check_pending( session );
> // ret == 0
> if ( ret == 0 )
> continue;
> gnutls_record_recv( session );
> }
>
More information about the Gnutls-help
mailing list