Skip to content

Commit

Permalink
SSL: fixed compression workaround to remove all methods.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mdounin committed Sep 27, 2012
1 parent 181d58f commit f4f72f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/event/ngx_event_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ ngx_ssl_init(ngx_log_t *log)
* Disable gzip compression in OpenSSL prior to 1.0.0 version,
* this saves about 522K per connection.
*/
int i, n;
int 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);
while (n--) {
(void) sk_SSL_COMP_pop(ssl_comp_methods);
}
}
#endif
Expand Down

0 comments on commit f4f72f9

Please sign in to comment.