summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_config.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2002-12-15 06:25:09 +0000
committerIgor Sysoev <igor@sysoev.ru>2002-12-15 06:25:09 +0000
commit42feecbdb694e114e034f0be67d19bba4165c363 (patch)
treeaea7c9c7c12f3cfef321901ddf92846815f1b876 /src/http/ngx_http_config.c
parent3add464b545b5dd29d07873b84f90fb77021d0c4 (diff)
downloadnginx-42feecbdb694e114e034f0be67d19bba4165c363.tar.gz
nginx-42feecbdb694e114e034f0be67d19bba4165c363.tar.bz2
nginx-0.0.1-2002-12-15-09:25:09 import
Diffstat (limited to '')
-rw-r--r--src/http/ngx_http_config.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/http/ngx_http_config.c b/src/http/ngx_http_config.c
index 36037c6cf..f298bd113 100644
--- a/src/http/ngx_http_config.c
+++ b/src/http/ngx_http_config.c
@@ -9,6 +9,8 @@
int ngx_max_module;
+int (*ngx_http_top_header_filter) (ngx_http_request_t *r);
+
/* STUB: gobal srv and loc conf */
void **ngx_srv_conf;
void **ngx_loc_conf;
@@ -53,13 +55,27 @@ int ngx_http_init_modules(ngx_pool_t *pool, ngx_http_module_t **modules)
int ngx_http_init_filters(ngx_pool_t *pool, ngx_http_module_t **modules)
{
int i;
- int (*filter)(ngx_http_request_t *r, ngx_chain_t *ch);
+ int (*ohf)(ngx_http_request_t *r);
+ int (*obf)(ngx_http_request_t *r, ngx_chain_t *ch);
+
+ ohf = NULL;
+
+ for (i = 0; modules[i]; i++) {
+ if (modules[i]->output_header_filter) {
+ modules[i]->next_output_header_filter = ohf;
+ ohf = modules[i]->output_header_filter;
+ }
+ }
- filter = ngx_http_write_filter;
+ ngx_http_top_header_filter = ohf;
+
+ obf = NULL;
for (i = 0; modules[i]; i++) {
- if (modules[i]->init_output_body_filter)
- modules[i]->init_output_body_filter(&filter);
+ if (modules[i]->output_body_filter) {
+ modules[i]->next_output_body_filter = obf;
+ obf = modules[i]->output_body_filter;
+ }
}
}