[nginx] svn commit: r4868 - trunk/src/event

mdounin at mdounin.ru mdounin at mdounin.ru
Thu Sep 27 17:59:59 UTC 2012


Author: mdounin
Date: 2012-09-27 17:59:59 +0000 (Thu, 27 Sep 2012)
New Revision: 4868
URL: http://trac.nginx.org/nginx/changeset/4868/nginx

Log:
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.


Modified:
   trunk/src/event/ngx_event_openssl.c

Modified: trunk/src/event/ngx_event_openssl.c
===================================================================
--- trunk/src/event/ngx_event_openssl.c	2012-09-27 15:01:57 UTC (rev 4867)
+++ trunk/src/event/ngx_event_openssl.c	2012-09-27 17:59:59 UTC (rev 4868)
@@ -100,14 +100,14 @@
      * 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



More information about the nginx-devel mailing list