]> git.kaiwu.me - nginx.git/commitdiff
Releasing memory of idle SSL connection. This saves about 34K per SSL
authorIgor Sysoev <igor@sysoev.ru>
Fri, 7 Oct 2011 12:15:20 +0000 (12:15 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 7 Oct 2011 12:15:20 +0000 (12:15 +0000)
connection. The SSL_MODE_RELEASE_BUFFERS option is available since
OpenSSL 1.0.0d.

src/event/ngx_event_openssl.c

index aa9a4c96a2f81ea61f4dcbd0dbfc4ef310838e11..bbec1db0eafd48f8b4da72a860d45dcea29161c1 100644 (file)
@@ -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);