[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnutls-dev
Subject:    Re: [gnutls-devel] Question about gnutls_record_uncork
From:       Nikos Mavrogiannopoulos <nmav () gnutls ! org>
Date:       2013-12-12 7:04:44
Message-ID: 1386831884.6039.4.camel () aspire ! lan
[Download RAW message or body]

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
explicit now.

regards,
Nikos



_______________________________________________
Gnutls-devel mailing list
Gnutls-devel@lists.gnutls.org
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic