[gnutls-devel] [gnutls-help] the problem about "stream usage" in dtls/sctp

Jeremy Harris jgh at wizmail.org
Sun May 14 15:28:17 CEST 2017


On 14/05/17 13:59, Nikos Mavrogiannopoulos wrote:
>> - the equivalent of send( , , , MSG_MORE).  I could do it with a push
>>   function, but that's just more hassle and I'd only be using it for
>>   my application protocol startup sequence anyway.
> 
> You can use the gnutls_record_cork() and uncork functions for that.
> Would that work for you, or did I miss the context?

They would work, but might mean I need to carry more state around.
I assume they're cheap calls?
Is uncork safe to call if cork has never been used?

>> - would there be any benefit in a sendfile() equivalent?  I assume
>> not
>>   for a userland/cpu driven session encryption engine - but are there
>>   any hardware engine implementations?
> 
> There is AF_KTLS [0] which can work with gnutls and can be used to
> achieve sendfile-like functionality. However I do not know whether
> something like that would ever reach mainline linux kernel. What
> functionality/optimization do you have in mind?

Hand it an fd and a TLS-context handle; copies data from the fd
and sends it down the TLS channel - using fewer syscalls and/or
expensive tls-library calls than an application loop: read,write,
and fewer bulk-data copies.

Bonus features are:
a) data size limit
b) starting seek-point in the source
c) support for non-seekable source fds   [ excluding (b) ]

-- 
Cheers,
  Jeremy



More information about the Gnutls-devel mailing list