Remove explicit setting of read_ahead for DTLS. It never makes sense not to
authorMatt Caswell <matt@openssl.org>
Mon, 26 Jan 2015 16:46:49 +0000 (16:46 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 27 Jan 2015 14:30:25 +0000 (14:30 +0000)
use read_ahead with DTLS because it doesn't work. Therefore read_ahead needs
to be the default.

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

apps/s_client.c
apps/s_server.c

index b1152aa362a5c28d7c064215bc85ee0a696b4930..8212c9fe4a52c03ba8e8100c6147bb94a6d6594c 100644 (file)
@@ -1295,12 +1295,6 @@ int MAIN(int argc, char **argv)
 #endif
     if (exc)
         ssl_ctx_set_excert(ctx, exc);
-    /*
-     * DTLS: partial reads end up discarding unread UDP bytes :-( Setting
-     * read ahead solves this problem.
-     */
-    if (socket_type == SOCK_DGRAM)
-        SSL_CTX_set_read_ahead(ctx, 1);
 
 #if !defined(OPENSSL_NO_TLSEXT)
 # if !defined(OPENSSL_NO_NEXTPROTONEG)
index baa2455e0723346c1792592b22424cbcb3699cc5..5709546ebf7c261e4d4189d11aa25f0b92421d0e 100644 (file)
@@ -1736,12 +1736,6 @@ int MAIN(int argc, char *argv[])
         SSL_CTX_set_options(ctx, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
     if (exc)
         ssl_ctx_set_excert(ctx, exc);
-    /*
-     * DTLS: partial reads end up discarding unread UDP bytes :-( Setting
-     * read ahead solves this problem.
-     */
-    if (socket_type == SOCK_DGRAM)
-        SSL_CTX_set_read_ahead(ctx, 1);
 
     if (state)
         SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
@@ -1821,12 +1815,6 @@ int MAIN(int argc, char *argv[])
             SSL_CTX_set_options(ctx2, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
         if (exc)
             ssl_ctx_set_excert(ctx2, exc);
-        /*
-         * DTLS: partial reads end up discarding unread UDP bytes :-(
-         * Setting read ahead solves this problem.
-         */
-        if (socket_type == SOCK_DGRAM)
-            SSL_CTX_set_read_ahead(ctx2, 1);
 
         if (state)
             SSL_CTX_set_info_callback(ctx2, apps_ssl_info_callback);