[gnutls-help] gnutls_record_send() behavior while corked

Attila Molnar attilamolnar at hush.com
Tue Mar 3 23:48:14 CET 2015


Hello everyone,

I'd like to use the corking functionality introduced in 3.1,
but there is something I don't fully understand.
The docs for gnutls_record_send() say that when corked

"All queued records will be sent when gnutls_uncork() is called
or when the maximum record size is reached.".

While testing I found that even if I give it more data than the
record size via multiple gnutls_record_send() calls, it accepts
all of it and does no output until gnutls_record_uncork() is called
which then sends multiple records.
gnutls_record_send() always returned a number equal to the number
of bytes given to it as data_size.

The latter half of the quote from the manual implies that
gnutls_record_send() can send records and thus call the push
function while corked.
Which one is it? Is it correct to assume that while corked,
gnutls_record_send() simply copies the data into an internal
buffer and the gnutls_record_uncork() function does something
equivalent to what gnutls_record_send() does when not corked,
but operates on all of the data given to it earlier?

Regards, Attila




More information about the Gnutls-help mailing list