diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2012-07-02 17:25:51 +0000 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2012-07-02 17:25:51 +0000 |
| commit | d4ee957632ed27aa26e1351cb3a3bb400fac30d1 (patch) | |
| tree | 18039abddb6d28cdf340e2e9a76630f1c59a6133 /src | |
| parent | 37cf05e2af4d5a4a6c5a437e12bae738fb00963f (diff) | |
| download | nginx-d4ee957632ed27aa26e1351cb3a3bb400fac30d1.tar.gz nginx-d4ee957632ed27aa26e1351cb3a3bb400fac30d1.tar.bz2 | |
Merge of r4697: disabled gzip in OpenSSL prior to 1.0.0.
Disabled gzip compression in OpenSSL prior to 1.0.0 version.
This saves about 522K per connection.
Diffstat (limited to 'src')
| -rw-r--r-- | src/event/ngx_event_openssl.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c index 30e588c82..4356a05ef 100644 --- a/src/event/ngx_event_openssl.c +++ b/src/event/ngx_event_openssl.c @@ -94,6 +94,24 @@ ngx_ssl_init(ngx_log_t *log) OpenSSL_add_all_algorithms(); +#ifndef SSL_OP_NO_COMPRESSION + { + /* + * Disable gzip compression in OpenSSL prior to 1.0.0 version, + * this saves about 522K per connection. + */ + int i, n; + STACK_OF(SSL_COMP) *ssl_comp_methods; + + ssl_comp_methods = SSL_COMP_get_compression_methods(); + n = sk_SSL_COMP_num(ssl_comp_methods); + + for (i = 0; i < n; i++) { + (void) sk_SSL_COMP_delete(ssl_comp_methods, i); + } + } +#endif + ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); if (ngx_ssl_connection_index == -1) { |
