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

List:       gnutls-dev
Subject:    Re: [gnutls-devel] gnutls_record_recv/gnutls_record_send and record length?
From:       Jaak Ristioja <jaak.ristioja () cyber ! ee>
Date:       2016-02-10 9:41:53
Message-ID: 56BB05E1.9050701 () cyber ! ee
[Download RAW message or body]

On 10.02.2016 10:54, Nikos Mavrogiannopoulos wrote:
> On Wed, Feb 10, 2016 at 12:15 AM, Jaak Ristioja <jaak.ristioja@cyber.ee> wrote:
>> Hi!
>> TLS 1.2 specifies a maximum record payload of 2^14 bytes. The GnuTLS
>> documentation for gnutls_record_send states that the maximum number of
>> bytes gnutls_record_send can send in a single call is determined by the
>> negotiated maximum record size (<= 2^14 bytes). Does gnutls_record_recv
>> have similar limitations? I'm thinking of implementing buffers for both
>> send and receive and I wonder whether 2^14-byte read and write buffers
>> will suffice to minimize the number of gnutls calls.
> 
> The answer is yes, you can rely gnutls_record_recv() to return data <=
> 2^14 per call.

This might be worth documenting.

> However to minimize the number of calls to gnutls you may consider to
> use gnutls_record_recv_packet(). That in addition will eliminate any
> need for copying buffers.

I didn't know that but it might help me a lot! Thanks!

Best regards,
Jaak


_______________________________________________
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