aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-10-07 12:15:20 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-10-07 12:15:20 +0000
commit94b5460c7002ff84cf675977c9b9f4228276ed6b (patch)
tree1b1c1fe8881ac859e04b300ba6bc3fca476585f4 /src
parent95084f7e1c14333c3ee1cb58f496924206001ecd (diff)
downloadnginx-94b5460c7002ff84cf675977c9b9f4228276ed6b.tar.gz
nginx-94b5460c7002ff84cf675977c9b9f4228276ed6b.zip
Releasing memory of idle SSL connection. This saves about 34K per SSL
connection. The SSL_MODE_RELEASE_BUFFERS option is available since OpenSSL 1.0.0d.
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_openssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index aa9a4c96a..bbec1db0e 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -179,6 +179,10 @@ ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols, void *data)
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_COMPRESSION);
#endif
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ SSL_CTX_set_mode(ssl->ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+
SSL_CTX_set_read_ahead(ssl->ctx, 1);
SSL_CTX_set_info_callback(ssl->ctx, ngx_ssl_info_callback);