Avoid unnecessary fragmentation.

(cherry picked from commit 80ccc66d7e)
This commit is contained in:
Michael Tuexen 2013-03-18 14:30:38 +00:00 committed by Dr. Stephen Henson
parent 1643edc63c
commit 05689a132c

View file

@ -313,9 +313,10 @@ int dtls1_do_write(SSL *s, int type)
s->init_off -= DTLS1_HM_HEADER_LENGTH; s->init_off -= DTLS1_HM_HEADER_LENGTH;
s->init_num += DTLS1_HM_HEADER_LENGTH; s->init_num += DTLS1_HM_HEADER_LENGTH;
/* write atleast DTLS1_HM_HEADER_LENGTH bytes */ if ( s->init_num > curr_mtu)
if ( len <= DTLS1_HM_HEADER_LENGTH) len = curr_mtu;
len += DTLS1_HM_HEADER_LENGTH; else
len = s->init_num;
} }
dtls1_fix_message_header(s, frag_off, dtls1_fix_message_header(s, frag_off,