Mercurial > hg > nginx
comparison src/event/ngx_event_openssl.c @ 4867:90bbf2adb2c9
SSL: fixed compression workaround to remove all methods.
Previous code used sk_SSL_COMP_delete(ssl_comp_methods, i) while iterating
stack from 0 to n, resulting in removal of only even compression methods.
In real life this change is a nop, as there is only one compression method
which is enabled by default in OpenSSL.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 27 Sep 2012 17:59:59 +0000 |
parents | b43fe2deb053 |
children | 22a6ef66b6f5 |
comparison
equal
deleted
inserted
replaced
4866:fac1cc762969 | 4867:90bbf2adb2c9 |
---|---|
98 { | 98 { |
99 /* | 99 /* |
100 * Disable gzip compression in OpenSSL prior to 1.0.0 version, | 100 * Disable gzip compression in OpenSSL prior to 1.0.0 version, |
101 * this saves about 522K per connection. | 101 * this saves about 522K per connection. |
102 */ | 102 */ |
103 int i, n; | 103 int n; |
104 STACK_OF(SSL_COMP) *ssl_comp_methods; | 104 STACK_OF(SSL_COMP) *ssl_comp_methods; |
105 | 105 |
106 ssl_comp_methods = SSL_COMP_get_compression_methods(); | 106 ssl_comp_methods = SSL_COMP_get_compression_methods(); |
107 n = sk_SSL_COMP_num(ssl_comp_methods); | 107 n = sk_SSL_COMP_num(ssl_comp_methods); |
108 | 108 |
109 for (i = 0; i < n; i++) { | 109 while (n--) { |
110 (void) sk_SSL_COMP_delete(ssl_comp_methods, i); | 110 (void) sk_SSL_COMP_pop(ssl_comp_methods); |
111 } | 111 } |
112 } | 112 } |
113 #endif | 113 #endif |
114 | 114 |
115 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); |