gnutls-devel
[Top][All Lists]
Advanced

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

Re: gnutls_record_check_pending() broken?


From: Peter Hendrickson
Subject: Re: gnutls_record_check_pending() broken?
Date: 28 May 2009 19:02:55 -0000

Simon writes:
> That won't work: the purpose of gnutls_record_check_pending() is to
> check if there is data stored in buffers within GnuTLS.  Before you
> call gnutls_record_recv, there won't be any data in the buffers.
> After a call to gnutls_record_recv, the data that was not returned
> to the caller of the function will be stored in an internal buffer.
> The purpose of the function is to find out if there is such data
> pending.

Okay, that makes sense to me.  This should be elaborated upon in the
documentation because the obvious use for this function is to ask "if
I run gnutls_record_recv() will it block?" which is apparently not
what it does.

> So I don't see a problem here actually.  It sounds as if you should use
> poll/select to check if there is data pending to be read from the
> socket.  When that is true, you should call gnutls_record_recv.

I needed to do that anyway, so no great loss. ;-)

Peter




reply via email to

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