diff options
author | emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-22 06:04:27 +0000 |
---|---|---|
committer | emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-22 06:04:27 +0000 |
commit | 41c517d13230dd3edd302a87231ac467babf2f3c (patch) | |
tree | e4ce1d465a3b8d921c1c6055b80e345c15437a57 /ext/openssl | |
parent | 914a4a025a493c17bba8262d1a13d6da2cef662f (diff) | |
download | ruby-41c517d13230dd3edd302a87231ac467babf2f3c.tar.gz |
* 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
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/ossl_ssl.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); } |