diff src/http/modules/ngx_http_gzip_filter_module.c @ 260:0effe91f6083 NGINX_0_5_0

nginx 0.5.0 *) Change: the parameters in the "%name" form in the "log_format" directive are not supported anymore. *) Change: the "proxy_upstream_max_fails", "proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", "fastcgi_upstream_fail_timeout", "memcached_upstream_max_fails", and "memcached_upstream_fail_timeout" directives are not supported anymore. *) Feature: the "server" directive in the "upstream" context supports the "max_fails", "fail_timeout", and "down" parameters. *) Feature: the "ip_hash" directive inside the "upstream" block. *) Feature: the WAIT status in the "Auth-Status" header line of the IMAP/POP3 proxy authentication server response. *) Bugfix: nginx could not be built on 64-bit platforms; bug appeared in 0.4.14.
author Igor Sysoev <http://sysoev.ru>
date Mon, 04 Dec 2006 00:00:00 +0300
parents 38e7b94d63ac
children 10cc350ed8a1
line wrap: on
line diff
--- a/src/http/modules/ngx_http_gzip_filter_module.c
+++ b/src/http/modules/ngx_http_gzip_filter_module.c
@@ -76,9 +76,6 @@ static void *ngx_http_gzip_filter_alloc(
 static void ngx_http_gzip_filter_free(void *opaque, void *address);
 static void ngx_http_gzip_error(ngx_http_gzip_ctx_t *ctx);
 
-static u_char *ngx_http_gzip_log_ratio(ngx_http_request_t *r, u_char *buf,
-    ngx_http_log_op_t *op);
-
 static ngx_int_t ngx_http_gzip_add_variables(ngx_conf_t *cf);
 static ngx_int_t ngx_http_gzip_ratio_variable(ngx_http_request_t *r,
     ngx_http_variable_value_t *v, uintptr_t data);
@@ -230,14 +227,6 @@ ngx_module_t  ngx_http_gzip_filter_modul
 };
 
 
-static ngx_http_log_op_name_t ngx_http_gzip_log_fmt_ops[] = {
-    { ngx_string("gzip_ratio"), NGX_INT32_LEN + 3,
-                                NULL, NULL, ngx_http_gzip_log_ratio },
-    { ngx_null_string, 0, NULL, NULL, NULL }
-};
-
-
-
 static u_char  gzheader[10] = { 0x1f, 0x8b, Z_DEFLATED, 0, 0, 0, 0, 0, 0, 3 };
 
 #if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED)
@@ -907,39 +896,6 @@ ngx_http_gzip_filter_free(void *opaque, 
 }
 
 
-static u_char *
-ngx_http_gzip_log_ratio(ngx_http_request_t *r, u_char *buf,
-    ngx_http_log_op_t *op)
-{
-    ngx_uint_t            zint, zfrac;
-    ngx_http_gzip_ctx_t  *ctx;
-
-    ctx = ngx_http_get_module_ctx(r, ngx_http_gzip_filter_module);
-
-    if (ctx == NULL || ctx->zout == 0) {
-        *buf = '-';
-        return buf + 1;
-    }
-
-    zint = (ngx_uint_t) (ctx->zin / ctx->zout);
-    zfrac = (ngx_uint_t) ((ctx->zin * 100 / ctx->zout) % 100);
-
-    if ((ctx->zin * 1000 / ctx->zout) % 10 > 4) {
-
-        /* the rounding, e.g., 2.125 to 2.13 */
-
-        zfrac++;
-
-        if (zfrac > 99) {
-            zint++;
-            zfrac = 0;
-        }
-    }
-
-    return ngx_sprintf(buf, "%ui.%02ui", zint, zfrac);
-}
-
-
 static void
 ngx_http_gzip_error(ngx_http_gzip_ctx_t *ctx)
 {
@@ -961,8 +917,7 @@ ngx_http_gzip_error(ngx_http_gzip_ctx_t 
 static ngx_int_t
 ngx_http_gzip_add_variables(ngx_conf_t *cf)
 {
-    ngx_http_variable_t     *var;
-    ngx_http_log_op_name_t  *op;
+    ngx_http_variable_t  *var;
 
     var = ngx_http_add_variable(cf, &ngx_http_gzip_ratio, NGX_HTTP_VAR_NOHASH);
     if (var == NULL) {
@@ -971,17 +926,6 @@ ngx_http_gzip_add_variables(ngx_conf_t *
 
     var->get_handler = ngx_http_gzip_ratio_variable;
 
-    for (op = ngx_http_gzip_log_fmt_ops; op->name.len; op++) { /* void */ }
-    op->run = NULL;
-
-    for (op = ngx_http_log_fmt_ops; op->run; op++) {
-        if (op->name.len == 0) {
-            op = (ngx_http_log_op_name_t *) op->run;
-        }
-    }
-
-    op->run = (ngx_http_log_op_run_pt) ngx_http_gzip_log_fmt_ops;
-
     return NGX_OK;
 }