comparison src/http/ngx_http_core_module.c @ 109:a9bc21d63fe4

nginx-0.0.1-2003-07-02-18:41:17 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 02 Jul 2003 14:41:17 +0000
parents 00bee6e7b485
children 152567c11325
comparison
equal deleted inserted replaced
108:adc093f880c8 109:a9bc21d63fe4
18 void *parent, void *child); 18 void *parent, void *child);
19 static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool); 19 static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool);
20 static char *ngx_http_core_merge_loc_conf(ngx_pool_t *pool, 20 static char *ngx_http_core_merge_loc_conf(ngx_pool_t *pool,
21 void *parent, void *child); 21 void *parent, void *child);
22 22
23 static int ngx_http_core_init(ngx_pool_t *pool); 23 static int ngx_http_core_init(ngx_cycle_t *cycle, ngx_log_t *log);
24 static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy); 24 static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy);
25 static int ngx_cmp_locations(const void *first, const void *second); 25 static int ngx_cmp_locations(const void *first, const void *second);
26 static char *ngx_location_block(ngx_conf_t *cf, ngx_command_t *cmd, 26 static char *ngx_location_block(ngx_conf_t *cf, ngx_command_t *cmd,
27 void *dummy); 27 void *dummy);
28 static char *ngx_types_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 28 static char *ngx_types_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
184 ngx_module_t ngx_http_core_module = { 184 ngx_module_t ngx_http_core_module = {
185 NGX_MODULE, 185 NGX_MODULE,
186 &ngx_http_core_module_ctx, /* module context */ 186 &ngx_http_core_module_ctx, /* module context */
187 ngx_http_core_commands, /* module directives */ 187 ngx_http_core_commands, /* module directives */
188 NGX_HTTP_MODULE, /* module type */ 188 NGX_HTTP_MODULE, /* module type */
189 ngx_http_core_init /* init module */ 189 ngx_http_core_init, /* init module */
190 NULL, /* commit module */
191 NULL /* rollback module */
190 }; 192 };
191 193
192 194
193 void ngx_http_handler(ngx_http_request_t *r) 195 void ngx_http_handler(ngx_http_request_t *r)
194 { 196 {
195 int rc, i; 197 int rc, i;
196 ngx_http_log_ctx_t *lcx; 198 ngx_http_log_ctx_t *lcx;
197 ngx_http_handler_pt *h; 199 ngx_http_handler_pt *h;
198 ngx_http_core_loc_conf_t *clcf, **clcfp; 200 ngx_http_core_loc_conf_t *clcf, **clcfp;
199 ngx_http_core_srv_conf_t *cscf; 201 ngx_http_core_srv_conf_t *cscf;
202 ngx_http_core_main_conf_t *cmcf;
200 203
201 r->connection->unexpected_eof = 0; 204 r->connection->unexpected_eof = 0;
202 205
203 lcx = r->connection->log->data; 206 lcx = r->connection->log->data;
204 lcx->action = NULL; 207 lcx->action = NULL;
246 249
247 if ((ngx_io.flags & NGX_IO_SENDFILE) == 0 || clcf->sendfile == 0) { 250 if ((ngx_io.flags & NGX_IO_SENDFILE) == 0 || clcf->sendfile == 0) {
248 r->filter = NGX_HTTP_FILTER_NEED_IN_MEMORY; 251 r->filter = NGX_HTTP_FILTER_NEED_IN_MEMORY;
249 } 252 }
250 253
254 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
255
251 /* run translation phase */ 256 /* run translation phase */
252 257
253 h = ngx_http_translate_handlers.elts; 258 h = cmcf->translate_handlers.elts;
254 for (i = ngx_http_translate_handlers.nelts - 1; i >= 0; i--) { 259 for (i = cmcf->translate_handlers.nelts - 1; i >= 0; i--) {
255 260
256 rc = h[i](r); 261 rc = h[i](r);
257 262
258 if (rc == NGX_DECLINED) { 263 if (rc == NGX_DECLINED) {
259 continue; 264 continue;
519 524
520 return NGX_OK; 525 return NGX_OK;
521 } 526 }
522 527
523 528
524 static int ngx_http_core_init(ngx_pool_t *pool) 529 static int ngx_http_core_init(ngx_cycle_t *cycle, ngx_log_t *log)
525 { 530 {
526 ngx_http_handler_pt *h; 531 ngx_http_handler_pt *h;
527 532
528 ngx_test_null(h, ngx_push_array(&ngx_http_translate_handlers), NGX_ERROR); 533 ngx_test_null(h, ngx_push_array(&ngx_http_translate_handlers), NGX_ERROR);
529 534