diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-06-26 10:02:22 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-07-10 07:40:17 +0000 |
commit | fd9cc393ba5fba46c2d98c2cb8470863039e75e2 (patch) | |
tree | 9a4283e1ab1a565fb0530425fdaf363341ffe819 /lib/record.h | |
parent | 2ef812203971c17d374ccbb3464397683a2c9477 (diff) | |
download | gnutls-fd9cc393ba5fba46c2d98c2cb8470863039e75e2.tar.gz |
priorities: share priority structures across sessions
As the contents of the priority cache grows, it makes sense to shared
these structures across many sessions (in server side) rather than
copying them to a session. All overrides of the priority contents
were moved to session->internals. On client side where gnutls_priority_set_direct()
is more commonly used, ensure that the set priority is deinitialized.
That also introduces gnutls_priority_set2() which does not copy the priority
contents by default.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/record.h')
-rw-r--r-- | lib/record.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/record.h b/lib/record.h index f16df4769d..6478d4253c 100644 --- a/lib/record.h +++ b/lib/record.h @@ -54,7 +54,7 @@ inline static unsigned max_record_recv_size(gnutls_session_t session) size = MAX_CIPHER_BLOCK_SIZE /*iv*/ + MAX_PAD_SIZE + MAX_HASH_SIZE/*MAC*/; - if (gnutls_compression_get(session)!=GNUTLS_COMP_NULL || session->internals.priorities.allow_large_records != 0) + if (gnutls_compression_get(session)!=GNUTLS_COMP_NULL || session->internals.allow_large_records != 0) size += EXTRA_COMP_SIZE; size += session->security_parameters.max_record_recv_size + RECORD_HEADER_SIZE(session); @@ -66,7 +66,7 @@ inline static unsigned max_decrypted_size(gnutls_session_t session) { unsigned size = 0; - if (session->internals.priorities.allow_large_records != 0) + if (session->internals.allow_large_records != 0) size += EXTRA_COMP_SIZE; size += session->security_parameters.max_record_recv_size; |