From be2457aaca6a5bae912a76a892952b4bd8f7b1e5 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 28 Nov 2010 21:03:41 -0800 Subject: [PATCH] Use SSL_MODE_RELEASE_BUFFERS by default. --- src/node_crypto.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index cc80e1b7b0..90219281b8 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -310,6 +310,11 @@ Handle SecureStream::New(const Arguments& args) { p->bio_write_ = BIO_new(BIO_s_mem()); SSL_set_bio(p->ssl_, p->bio_read_, p->bio_write_); +#ifdef SSL_MODE_RELEASE_BUFFERS + long mode = SSL_get_mode(p->ssl_); + SSL_set_mode(p->ssl_, mode | SSL_MODE_RELEASE_BUFFERS); +#endif + if ((p->should_verify_ = should_verify)) { SSL_set_verify(p->ssl_, SSL_VERIFY_PEER, verify_callback); }