comparison src/event/ngx_event_openssl.c @ 4731:9efa21520c84 stable-1.2

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 02 Jul 2012 17:25:51 +0000
parents e92582b7da05
children 90bbf2adb2c9 a0cb7fc23cc2
comparison
equal deleted inserted replaced
4730:148da28b80ed 4731:9efa21520c84
91 91
92 SSL_library_init(); 92 SSL_library_init();
93 SSL_load_error_strings(); 93 SSL_load_error_strings();
94 94
95 OpenSSL_add_all_algorithms(); 95 OpenSSL_add_all_algorithms();
96
97 #ifndef SSL_OP_NO_COMPRESSION
98 {
99 /*
100 * Disable gzip compression in OpenSSL prior to 1.0.0 version,
101 * this saves about 522K per connection.
102 */
103 int i, n;
104 STACK_OF(SSL_COMP) *ssl_comp_methods;
105
106 ssl_comp_methods = SSL_COMP_get_compression_methods();
107 n = sk_SSL_COMP_num(ssl_comp_methods);
108
109 for (i = 0; i < n; i++) {
110 (void) sk_SSL_COMP_delete(ssl_comp_methods, i);
111 }
112 }
113 #endif
96 114
97 ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); 115 ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
98 116
99 if (ngx_ssl_connection_index == -1) { 117 if (ngx_ssl_connection_index == -1) {
100 ngx_ssl_error(NGX_LOG_ALERT, log, 0, "SSL_get_ex_new_index() failed"); 118 ngx_ssl_error(NGX_LOG_ALERT, log, 0, "SSL_get_ex_new_index() failed");