[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnutls_record_check_pending() broken?
From: |
Simon Josefsson |
Subject: |
Re: gnutls_record_check_pending() broken? |
Date: |
Thu, 28 May 2009 22:18:58 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux) |
Peter Hendrickson <address@hidden> writes:
> 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.
It can be used for that -- gnutls_record_recv will never invoke the pull
function (and thus will never block) if you call it with a sizeofdata
parameter less/equal to what gnutls_record_check_pending has just
returned.
/Simon