Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 297:ee394e997c77
nginx-0.0.3-2004-03-29-21:43:58 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 29 Mar 2004 17:43:58 +0000 |
parents | 5cfd65b8b0a7 |
children | 502b03d9d2a3 |
comparison
equal
deleted
inserted
replaced
296:bfe099e3f5b4 | 297:ee394e997c77 |
---|---|
420 | 420 |
421 | 421 |
422 int ngx_http_find_location_config(ngx_http_request_t *r) | 422 int ngx_http_find_location_config(ngx_http_request_t *r) |
423 { | 423 { |
424 int rc; | 424 int rc; |
425 ngx_uint_t i, exact; | 425 ngx_uint_t i; |
426 ngx_str_t *auto_redirect; | 426 ngx_str_t *auto_redirect; |
427 ngx_http_core_loc_conf_t *clcf, **clcfp; | 427 ngx_http_core_loc_conf_t *clcf, **clcfp; |
428 ngx_http_core_srv_conf_t *cscf; | 428 ngx_http_core_srv_conf_t *cscf; |
429 #if (HAVE_PCRE) | |
430 ngx_uint_t exact; | |
431 #endif | |
429 | 432 |
430 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); | 433 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); |
431 auto_redirect = NULL; | 434 auto_redirect = NULL; |
435 #if (HAVE_PCRE) | |
432 exact = 0; | 436 exact = 0; |
437 #endif | |
433 | 438 |
434 clcfp = cscf->locations.elts; | 439 clcfp = cscf->locations.elts; |
435 for (i = 0; i < cscf->locations.nelts; i++) { | 440 for (i = 0; i < cscf->locations.nelts; i++) { |
436 | 441 |
437 #if (HAVE_PCRE) | 442 #if (HAVE_PCRE) |
471 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 476 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
472 r->connection->log->file = clcf->err_log->file; | 477 r->connection->log->file = clcf->err_log->file; |
473 r->connection->log->log_level = clcf->err_log->log_level; | 478 r->connection->log->log_level = clcf->err_log->log_level; |
474 | 479 |
475 if (clcfp[i]->exact_match && r->uri.len == clcfp[i]->name.len) { | 480 if (clcfp[i]->exact_match && r->uri.len == clcfp[i]->name.len) { |
481 #if (HAVE_PCRE) | |
476 exact = 1; | 482 exact = 1; |
483 #endif | |
477 break; | 484 break; |
478 } | 485 } |
479 } | 486 } |
480 } | 487 } |
481 | 488 |
749 | 756 |
750 static int ngx_http_core_init(ngx_cycle_t *cycle) | 757 static int ngx_http_core_init(ngx_cycle_t *cycle) |
751 { | 758 { |
752 #if 0 | 759 #if 0 |
753 ngx_http_handler_pt *h; | 760 ngx_http_handler_pt *h; |
754 #endif | |
755 ngx_http_conf_ctx_t *ctx; | 761 ngx_http_conf_ctx_t *ctx; |
756 ngx_http_core_main_conf_t *cmcf; | 762 ngx_http_core_main_conf_t *cmcf; |
757 | 763 |
758 ctx = (ngx_http_conf_ctx_t *) cycle->conf_ctx[ngx_http_module.index]; | 764 ctx = (ngx_http_conf_ctx_t *) cycle->conf_ctx[ngx_http_module.index]; |
759 cmcf = ctx->main_conf[ngx_http_core_module.ctx_index]; | 765 cmcf = ctx->main_conf[ngx_http_core_module.ctx_index]; |
760 | 766 |
761 #if 0 | |
762 ngx_test_null(h, ngx_push_array( | 767 ngx_test_null(h, ngx_push_array( |
763 &cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers), | 768 &cmcf->phases[NGX_HTTP_TRANSLATE_PHASE].handlers), |
764 NGX_ERROR); | 769 NGX_ERROR); |
765 *h = ngx_http_delay_handler; | 770 *h = ngx_http_delay_handler; |
766 #endif | 771 #endif |
773 { | 778 { |
774 int m; | 779 int m; |
775 char *rv; | 780 char *rv; |
776 ngx_http_module_t *module; | 781 ngx_http_module_t *module; |
777 ngx_conf_t pcf; | 782 ngx_conf_t pcf; |
778 ngx_http_conf_ctx_t *ctx, *hctx, *pctx; | 783 ngx_http_conf_ctx_t *ctx, *hctx; |
779 ngx_http_core_main_conf_t *cmcf; | 784 ngx_http_core_main_conf_t *cmcf; |
780 ngx_http_core_srv_conf_t *cscf, **cscfp; | 785 ngx_http_core_srv_conf_t *cscf, **cscfp; |
781 | 786 |
782 ngx_test_null(ctx, | 787 ngx_test_null(ctx, |
783 ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)), | 788 ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t)), |
828 *cscfp = cscf; | 833 *cscfp = cscf; |
829 | 834 |
830 /* parse inside server{} */ | 835 /* parse inside server{} */ |
831 | 836 |
832 pcf = *cf; | 837 pcf = *cf; |
838 #if 0 | |
833 pctx = cf->ctx; | 839 pctx = cf->ctx; |
840 #endif | |
834 cf->ctx = ctx; | 841 cf->ctx = ctx; |
835 cf->cmd_type = NGX_HTTP_SRV_CONF; | 842 cf->cmd_type = NGX_HTTP_SRV_CONF; |
836 rv = ngx_conf_parse(cf, NULL); | 843 rv = ngx_conf_parse(cf, NULL); |
837 *cf = pcf; | 844 *cf = pcf; |
838 | 845 |