summaryrefslogtreecommitdiffstats
path: root/x-net/src
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-11-17 15:33:33 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-11-17 16:23:19 -0800
commit4c2b39ae80c2878fb7fdf8a3ccbdb5d6156e8701 (patch)
tree1ae1136144eda13df581bab162c86e2d5c1a2578 /x-net/src
parent6afd1e297342111db635163614383d62937ce5eb (diff)
downloadlibcore-4c2b39ae80c2878fb7fdf8a3ccbdb5d6156e8701.zip
libcore-4c2b39ae80c2878fb7fdf8a3ccbdb5d6156e8701.tar.gz
libcore-4c2b39ae80c2878fb7fdf8a3ccbdb5d6156e8701.tar.bz2
protect use of SMALL_BUFFERS and HANDSHAKE_CUTTHROUGH
Diffstat (limited to 'x-net/src')
-rw-r--r--x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
index 1a6c3ae..646ae97 100644
--- a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
+++ b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
@@ -1021,10 +1021,15 @@ static void org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl_init(JNIEnv*
* and undesirable.)
*/
mode |= SSL_MODE_ENABLE_PARTIAL_WRITE;
+#if defined(SSL_MODE_SMALL_BUFFERS) /* not all SSL versions have this */
mode |= SSL_MODE_SMALL_BUFFERS; /* lazily allocate record buffers; usually saves
* 44k over the default */
+#endif
+#if defined(SSL_MODE_HANDSHAKE_CUTTHROUGH) /* not all SSL versions have this */
mode |= SSL_MODE_HANDSHAKE_CUTTHROUGH; /* enable sending of client data as soon as
* ClientCCS and ClientFinished are sent */
+#endif
+
SSL_CTX_set_mode(ssl_ctx, mode);
if (privatekey != NULL) {