Make DTLS always act as if read_ahead is set. The actual value of read_ahead
authorMatt Caswell <matt@openssl.org>
Mon, 26 Jan 2015 16:47:36 +0000 (16:47 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 27 Jan 2015 14:33:32 +0000 (14:33 +0000)
is ignored for DTLS.

RT#3657

Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 8dd4ad0ff5d1d07ec4b6dd5d5104131269a472aa)

ssl/s3_pkt.c

index 5644dd8f26b751c2716373c3668293c71cbf5b14..d422abfda0e61daaf87d92a1f820a207e3bbb6f3 100644 (file)
@@ -217,7 +217,8 @@ int ssl3_read_n(SSL *s, int n, int max, int extend)
         return -1;
     }
 
-    if (!s->read_ahead)
+    /* We always act like read_ahead is set for DTLS */
+    if (!s->read_ahead && !SSL_IS_DTLS(s))
         /* ignore max parameter */
         max = n;
     else {