summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-22 06:04:27 +0000
committeremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-22 06:04:27 +0000
commit41c517d13230dd3edd302a87231ac467babf2f3c (patch)
treee4ce1d465a3b8d921c1c6055b80e345c15437a57
parent914a4a025a493c17bba8262d1a13d6da2cef662f (diff)
* ext/openssl/ossl_ssl.c: Use SSL_MODE_RELEASE_BUFFERS if available.
Thanks, Eric Wong, for providing the patch. [ Ruby 1.9 - Feature #4672 ] [ruby-core:36127] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/openssl/ossl_ssl.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index eaaabb4f88..614c8cbdbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jun 22 15:01:24 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_ssl.c: Use SSL_MODE_RELEASE_BUFFERS if available.
+ Thanks, Eric Wong, for providing the patch.
+ [ Ruby 1.9 - Feature #4672 ] [ruby-core:36127]
+
Wed Jun 22 14:47:53 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* test/openssl/test_buffering.rb
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 3122c0e4ea..bcfaa32182 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -140,12 +140,17 @@ static VALUE
ossl_sslctx_s_alloc(VALUE klass)
{
SSL_CTX *ctx;
+ long mode = SSL_MODE_ENABLE_PARTIAL_WRITE;
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ mode |= SSL_MODE_RELEASE_BUFFERS;
+#endif
ctx = SSL_CTX_new(SSLv23_method());
if (!ctx) {
ossl_raise(eSSLError, "SSL_CTX_new:");
}
- SSL_CTX_set_mode(ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
+ SSL_CTX_set_mode(ctx, mode);
SSL_CTX_set_options(ctx, SSL_OP_ALL);
return Data_Wrap_Struct(klass, 0, ossl_sslctx_free, ctx);
}