summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-09-01 16:46:04 +0300
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-09-01 16:46:18 +0300
commit1f53d69d469c47117a0ae096a1675122930b93fb (patch)
tree4dcf68a03e5d6200a78ea95544356b5a79cb0423 /lib
parentd4726f7c7b322bcf1882abbc2254dade4b1c9261 (diff)
downloadgnutls-1f53d69d469c47117a0ae096a1675122930b93fb.tar.gz
corrected max_user_send_size() for DTLS.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_int.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index 2c892f5166..f3974c46ad 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -1068,14 +1068,17 @@ size_t max;
if (IS_DTLS(session))
max = gnutls_dtls_get_data_mtu(session);
- else
- max = session->security_parameters.max_record_send_size;
+ else
+ {
+ max = session->security_parameters.max_record_send_size;
+ /* DTLS data MTU accounts for those */
- if (record_params->write.new_record_padding != 0)
- max -= 2;
+ if (record_params->write.new_record_padding != 0)
+ max -= 2;
- if (_gnutls_cipher_is_block (record_params->cipher))
- max -= _gnutls_cipher_get_block_size(record_params->cipher);
+ if (_gnutls_cipher_is_block (record_params->cipher))
+ max -= _gnutls_cipher_get_block_size(record_params->cipher);
+ }
return max;
}