[gnutls-devel] Question about gnutls_record_uncork
nmav at gnutls.org
Thu Dec 12 08:04:44 CET 2013
On Mon, 2013-12-09 at 15:24 +0200, Jaak Ristioja wrote:
> The use case is very complicated, but basically it needs to keep track
> of whether all corked data has actually been sent or not. Using
> GNUTLS_RECORD_WAIT is not an option for us, because in some cases the
> underlying TCP buffers get full on both endpoints at the same time hence
> causing a livelock (async. I/O, can't call gnutls_record_recv while the
> other thread is in gnutls_record_uncork; both endpoints try to uncork at
> the same time).
> What might help would be a function to return the value of the variable
> session->internals.record_presend_buffer.length. However, I think I will
> currently use something like this to work around the problem:
I've added gnutls_record_check_corked() to check the amount of data
present in the cork buffer, to be included in 3.2.8. That would not be
of much use to you as you worked it around, but I there are indeed other
use cases where such a function would simplify things.
> PS: The documentation states that "On success the number of transmitted
> data is returned" by gnutls_record_uncork. Because the non-negative
> return value can't be reasonably used, maybe it were be better to state
> "On success, a non-negative number is returned".
I think that depends on the definition of success. I've made that more
More information about the Gnutls-devel