diff src/http/modules/ngx_http_userid_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 fbf2b2f66c9f
children 10cc350ed8a1
line wrap: on
line diff
--- a/src/http/modules/ngx_http_userid_filter_module.c
+++ b/src/http/modules/ngx_http_userid_filter_module.c
@@ -46,15 +46,6 @@ static void ngx_http_userid_get_uid(ngx_
 static ngx_int_t ngx_http_userid_set_uid(ngx_http_request_t *r,
     ngx_http_userid_ctx_t *ctx, ngx_http_userid_conf_t *conf);
 
-static size_t ngx_http_userid_log_uid_got_getlen(ngx_http_request_t *r,
-    uintptr_t data);
-static u_char *ngx_http_userid_log_uid_got(ngx_http_request_t *r, u_char *buf,
-    ngx_http_log_op_t *op);
-static size_t ngx_http_userid_log_uid_set_getlen(ngx_http_request_t *r,
-    uintptr_t data);
-static u_char *ngx_http_userid_log_uid_set(ngx_http_request_t *r, u_char *buf,
-    ngx_http_log_op_t *op);
-
 static ngx_int_t ngx_http_userid_add_variables(ngx_conf_t *cf);
 static ngx_int_t ngx_http_userid_variable(ngx_http_request_t *r,
     ngx_http_variable_value_t *v, uintptr_t data);
@@ -191,17 +182,6 @@ ngx_module_t  ngx_http_userid_filter_mod
 };
 
 
-static ngx_http_log_op_name_t ngx_http_userid_log_fmt_ops[] = {
-    { ngx_string("uid_got"), 0, NULL,
-                                ngx_http_userid_log_uid_got_getlen,
-                                ngx_http_userid_log_uid_got },
-    { ngx_string("uid_set"), 0, NULL,
-                                ngx_http_userid_log_uid_set_getlen,
-                                ngx_http_userid_log_uid_set },
-    { ngx_null_string, 0, NULL, NULL, NULL }
-};
-
-
 static ngx_str_t  ngx_http_userid_got = ngx_string("uid_got");
 static ngx_str_t  ngx_http_userid_set = ngx_string("uid_set");
 
@@ -462,99 +442,10 @@ ngx_http_userid_set_uid(ngx_http_request
 }
 
 
-static size_t
-ngx_http_userid_log_uid_got_getlen(ngx_http_request_t *r, uintptr_t data)
-{
-    ngx_http_userid_ctx_t   *ctx;
-    ngx_http_userid_conf_t  *conf;
-
-    ctx = ngx_http_get_module_ctx(r, ngx_http_userid_filter_module);
-
-    if (ctx == NULL || ctx->uid_got[3] == 0) {
-        return 1;
-    }
-
-    conf = ngx_http_get_module_loc_conf(r, ngx_http_userid_filter_module);
-
-    return conf->name.len + 1 + 32;
-}
-
-
-static u_char *
-ngx_http_userid_log_uid_got(ngx_http_request_t *r, u_char *buf,
-    ngx_http_log_op_t *op)
-{
-    ngx_http_userid_ctx_t   *ctx;
-    ngx_http_userid_conf_t  *conf;
-
-    ctx = ngx_http_get_module_ctx(r, ngx_http_userid_filter_module);
-
-    if (ctx == NULL || ctx->uid_got[3] == 0) {
-        *buf = '-';
-        return buf + 1;
-    }
-
-    conf = ngx_http_get_module_loc_conf(r, ngx_http_userid_filter_module);
-
-    buf = ngx_copy(buf, conf->name.data, conf->name.len);
-
-    *buf++ = '=';
-
-    return ngx_sprintf(buf, "%08XD%08XD%08XD%08XD",
-                       ctx->uid_got[0], ctx->uid_got[1],
-                       ctx->uid_got[2], ctx->uid_got[3]);
-}
-
-
-static size_t
-ngx_http_userid_log_uid_set_getlen(ngx_http_request_t *r, uintptr_t data)
-{
-    ngx_http_userid_ctx_t   *ctx;
-    ngx_http_userid_conf_t  *conf;
-
-    ctx = ngx_http_get_module_ctx(r, ngx_http_userid_filter_module);
-
-    if (ctx == NULL || ctx->uid_set[3] == 0) {
-        return 1;
-    }
-
-    conf = ngx_http_get_module_loc_conf(r, ngx_http_userid_filter_module);
-
-    return conf->name.len + 1 + 32;
-}
-
-
-static u_char *
-ngx_http_userid_log_uid_set(ngx_http_request_t *r, u_char *buf,
-    ngx_http_log_op_t *op)
-{
-    ngx_http_userid_ctx_t   *ctx;
-    ngx_http_userid_conf_t  *conf;
-
-    ctx = ngx_http_get_module_ctx(r, ngx_http_userid_filter_module);
-
-    if (ctx == NULL || ctx->uid_set[3] == 0) {
-        *buf = '-';
-        return buf + 1;
-    }
-
-    conf = ngx_http_get_module_loc_conf(r, ngx_http_userid_filter_module);
-
-    buf = ngx_copy(buf, conf->name.data, conf->name.len);
-
-    *buf++ = '=';
-
-    return ngx_sprintf(buf, "%08XD%08XD%08XD%08XD",
-                       ctx->uid_set[0], ctx->uid_set[1],
-                       ctx->uid_set[2], ctx->uid_set[3]);
-}
-
-
 static ngx_int_t
 ngx_http_userid_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_userid_got, NGX_HTTP_VAR_NOHASH);
     if (var == NULL) {
@@ -572,18 +463,6 @@ ngx_http_userid_add_variables(ngx_conf_t
     var->get_handler = ngx_http_userid_variable;
     var->data = offsetof(ngx_http_userid_ctx_t, uid_set);
 
-
-    for (op = ngx_http_userid_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_userid_log_fmt_ops;
-
     return NGX_OK;
 }