diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-03-20 16:09:44 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-03-20 16:09:44 +0000 |
commit | dc479b4d98d5b65b78689c5282a31c70efadd928 (patch) | |
tree | 7caf32d89eec03484b14ebe74dfefd2a80c8fa02 /src/http/ngx_http.c | |
parent | 90ace68b69606b885578686e19d499a50d5e80b7 (diff) | |
download | nginx-dc479b4d98d5b65b78689c5282a31c70efadd928.tar.gz nginx-dc479b4d98d5b65b78689c5282a31c70efadd928.zip |
nginx-0.0.1-2003-03-20-19:09:44 import
Diffstat (limited to 'src/http/ngx_http.c')
-rw-r--r-- | src/http/ngx_http.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c index 954b1cfc0..9c648f70a 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -28,6 +28,7 @@ int ngx_http_large_client_header = 1; int ngx_http_url_in_error_log = 1; +ngx_array_t ngx_http_translate_handlers; ngx_array_t ngx_http_index_handlers; @@ -61,13 +62,12 @@ ngx_module_t ngx_http_module = { static void ngx_http_init_filters(ngx_pool_t *pool, ngx_module_t **modules) { - int i; - ngx_http_module_t *module; - int (*ohf)(ngx_http_request_t *r); - int (*obf)(ngx_http_request_t *r, ngx_chain_t *ch); + int i; + ngx_http_module_t *module; + ngx_http_conf_filter_t cf; - ohf = NULL; - obf = NULL; + cf.output_header_filter = NULL; + cf.output_body_filter = NULL; for (i = 0; modules[i]; i++) { if (modules[i]->type != NGX_HTTP_MODULE_TYPE) { @@ -76,18 +76,12 @@ static void ngx_http_init_filters(ngx_pool_t *pool, ngx_module_t **modules) module = (ngx_http_module_t *) modules[i]->ctx; - if (module->output_header_filter) { - module->next_output_header_filter = ohf; - ohf = module->output_header_filter; - } - - if (module->output_body_filter) { - module->next_output_body_filter = obf; - obf = module->output_body_filter; + if (module->init_filters) { + module->init_filters(pool, &cf); } } - ngx_http_top_header_filter = ohf; + ngx_http_top_header_filter = cf.output_header_filter; } @@ -119,10 +113,6 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy) continue; } - /* STUB */ - module = (ngx_http_module_t *) ngx_modules[i]->ctx; - module->index = ngx_http_max_module; - ngx_modules[i]->index = ngx_http_max_module++; } @@ -139,7 +129,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy) module = (ngx_http_module_t *) ngx_modules[i]->ctx; if (module->create_loc_conf) { - ngx_test_null(ctx->loc_conf[module->index], + ngx_test_null(ctx->loc_conf[ngx_modules[i]->index], module->create_loc_conf(cf->pool), NGX_CONF_ERROR); } @@ -173,6 +163,9 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy) /**/ #endif + ngx_init_array(ngx_http_translate_handlers, + cf->pool, 10, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR); + ngx_init_array(ngx_http_index_handlers, cf->pool, 3, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR); |