]> granicus.if.org Git - openssl/commitdiff
Avoid unnecessary fragmentation.
authorMichael Tuexen <tuexen@fh-muenster.de>
Mon, 18 Mar 2013 14:30:38 +0000 (14:30 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 18 Mar 2013 14:30:38 +0000 (14:30 +0000)
ssl/d1_both.c

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