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:35:11 +0000 (14:35 +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)

Conflicts:
apps/s_client.c
apps/s_server.c

apps/s_client.c
apps/s_server.c

index 0bbc06524820c67da0740b60458e40057ae70260..758fb2563e665d7e7294891464e6edbd6585bf0c 100644 (file)
@@ -1149,12 +1149,6 @@ int MAIN(int argc, char **argv)
 
     if (clr)
         SSL_CTX_clear_options(ctx, clr);
-    /*
-     * 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) && !defined(OPENSSL_NO_NEXTPROTONEG)
     if (next_proto.data)
index 0cac749fd4a3337b07733fd3b64b6d1a5ae27c21..70ee5c341fe4e65b6b56645a8f30ede8d05174cb 100644 (file)
@@ -1541,12 +1541,6 @@ int MAIN(int argc, char *argv[])
     if (hack)
         SSL_CTX_set_options(ctx, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
     SSL_CTX_set_options(ctx, off);
-    /*
-     * 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);
@@ -1614,12 +1608,6 @@ int MAIN(int argc, char *argv[])
         if (hack)
             SSL_CTX_set_options(ctx2, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
         SSL_CTX_set_options(ctx2, off);
-        /*
-         * 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);