Mercurial > hg > nginx-quic
comparison src/http/ngx_http.c @ 69:e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 20 Mar 2003 16:09:44 +0000 |
parents | 5a7d1aaa1618 |
children | 59229033ae93 |
comparison
equal
deleted
inserted
replaced
68:d549fdc17d7e | 69:e43f406e4525 |
---|---|
26 int ngx_http_large_client_header = 1; | 26 int ngx_http_large_client_header = 1; |
27 | 27 |
28 int ngx_http_url_in_error_log = 1; | 28 int ngx_http_url_in_error_log = 1; |
29 | 29 |
30 | 30 |
31 ngx_array_t ngx_http_translate_handlers; | |
31 ngx_array_t ngx_http_index_handlers; | 32 ngx_array_t ngx_http_index_handlers; |
32 | 33 |
33 | 34 |
34 int (*ngx_http_top_header_filter) (ngx_http_request_t *r); | 35 int (*ngx_http_top_header_filter) (ngx_http_request_t *r); |
35 | 36 |
59 | 60 |
60 | 61 |
61 | 62 |
62 static void ngx_http_init_filters(ngx_pool_t *pool, ngx_module_t **modules) | 63 static void ngx_http_init_filters(ngx_pool_t *pool, ngx_module_t **modules) |
63 { | 64 { |
64 int i; | 65 int i; |
65 ngx_http_module_t *module; | 66 ngx_http_module_t *module; |
66 int (*ohf)(ngx_http_request_t *r); | 67 ngx_http_conf_filter_t cf; |
67 int (*obf)(ngx_http_request_t *r, ngx_chain_t *ch); | 68 |
68 | 69 cf.output_header_filter = NULL; |
69 ohf = NULL; | 70 cf.output_body_filter = NULL; |
70 obf = NULL; | |
71 | 71 |
72 for (i = 0; modules[i]; i++) { | 72 for (i = 0; modules[i]; i++) { |
73 if (modules[i]->type != NGX_HTTP_MODULE_TYPE) { | 73 if (modules[i]->type != NGX_HTTP_MODULE_TYPE) { |
74 continue; | 74 continue; |
75 } | 75 } |
76 | 76 |
77 module = (ngx_http_module_t *) modules[i]->ctx; | 77 module = (ngx_http_module_t *) modules[i]->ctx; |
78 | 78 |
79 if (module->output_header_filter) { | 79 if (module->init_filters) { |
80 module->next_output_header_filter = ohf; | 80 module->init_filters(pool, &cf); |
81 ohf = module->output_header_filter; | 81 } |
82 } | 82 } |
83 | 83 |
84 if (module->output_body_filter) { | 84 ngx_http_top_header_filter = cf.output_header_filter; |
85 module->next_output_body_filter = obf; | |
86 obf = module->output_body_filter; | |
87 } | |
88 } | |
89 | |
90 ngx_http_top_header_filter = ohf; | |
91 } | 85 } |
92 | 86 |
93 | 87 |
94 static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy) | 88 static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy) |
95 { | 89 { |
117 for (i = 0; ngx_modules[i]; i++) { | 111 for (i = 0; ngx_modules[i]; i++) { |
118 if (ngx_modules[i]->type != NGX_HTTP_MODULE_TYPE) { | 112 if (ngx_modules[i]->type != NGX_HTTP_MODULE_TYPE) { |
119 continue; | 113 continue; |
120 } | 114 } |
121 | 115 |
122 /* STUB */ | |
123 module = (ngx_http_module_t *) ngx_modules[i]->ctx; | |
124 module->index = ngx_http_max_module; | |
125 | |
126 ngx_modules[i]->index = ngx_http_max_module++; | 116 ngx_modules[i]->index = ngx_http_max_module++; |
127 } | 117 } |
128 | 118 |
129 /* null loc_conf */ | 119 /* null loc_conf */ |
130 ngx_test_null(ctx->loc_conf, | 120 ngx_test_null(ctx->loc_conf, |
137 } | 127 } |
138 | 128 |
139 module = (ngx_http_module_t *) ngx_modules[i]->ctx; | 129 module = (ngx_http_module_t *) ngx_modules[i]->ctx; |
140 | 130 |
141 if (module->create_loc_conf) { | 131 if (module->create_loc_conf) { |
142 ngx_test_null(ctx->loc_conf[module->index], | 132 ngx_test_null(ctx->loc_conf[ngx_modules[i]->index], |
143 module->create_loc_conf(cf->pool), | 133 module->create_loc_conf(cf->pool), |
144 NGX_CONF_ERROR); | 134 NGX_CONF_ERROR); |
145 } | 135 } |
146 } | 136 } |
147 | 137 |
170 &loc[l]->doc_root _ loc[l]->doc_root.data); | 160 &loc[l]->doc_root _ loc[l]->doc_root.data); |
171 } | 161 } |
172 } | 162 } |
173 /**/ | 163 /**/ |
174 #endif | 164 #endif |
165 | |
166 ngx_init_array(ngx_http_translate_handlers, | |
167 cf->pool, 10, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR); | |
175 | 168 |
176 ngx_init_array(ngx_http_index_handlers, | 169 ngx_init_array(ngx_http_index_handlers, |
177 cf->pool, 3, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR); | 170 cf->pool, 3, sizeof(ngx_http_handler_pt), NGX_CONF_ERROR); |
178 | 171 |
179 ngx_http_init_filters(cf->pool, ngx_modules); | 172 ngx_http_init_filters(cf->pool, ngx_modules); |