comparison src/http/ngx_http_core_module.c @ 38:2879cd3a40cb NGINX_0_1_19

nginx 0.1.19 *) Bugfix: now, if request contains the zero, then the 404 error is returned for the local requests. *) Bugfix: nginx could not be built on NetBSD 2.0. *) Bugfix: the timeout may occur while reading of the the client request body via SSL connections.
author Igor Sysoev <http://sysoev.ru>
date Wed, 16 Feb 2005 00:00:00 +0300
parents a39d1b793287
children 6cfc63e68377
comparison
equal deleted inserted replaced
37:3376a7dea5d6 38:2879cd3a40cb
413 413
414 r->connection->write->event_handler = ngx_http_core_phase_event_handler; 414 r->connection->write->event_handler = ngx_http_core_phase_event_handler;
415 415
416 r->uri_changed = 1; 416 r->uri_changed = 1;
417 r->uri_changes = 11; 417 r->uri_changes = 11;
418 r->phase = NGX_HTTP_REWRITE_PHASE;
419 r->phase_handler = 0;
418 420
419 ngx_http_core_run_phases(r); 421 ngx_http_core_run_phases(r);
420 } 422 }
421 423
422 424
445 447
446 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); 448 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
447 449
448 for (/* void */; r->phase < NGX_HTTP_LAST_PHASE; r->phase++) { 450 for (/* void */; r->phase < NGX_HTTP_LAST_PHASE; r->phase++) {
449 451
450 if (r->phase == NGX_HTTP_FIND_CONFIG_PHASE && !r->uri_changed) { 452 if (r->phase == NGX_HTTP_REWRITE_PHASE + 1 && r->uri_changed) {
451 continue;
452 }
453
454 if (r->phase == NGX_HTTP_FIND_CONFIG_PHASE + 1 && r->uri_changed) {
455 453
456 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 454 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
457 "uri changes: %d", r->uri_changes); 455 "uri changes: %d", r->uri_changes);
458 456
459 /* 457 /*
470 "rewrite cycle"); 468 "rewrite cycle");
471 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); 469 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
472 return; 470 return;
473 } 471 }
474 472
475 r->uri_changed = 0; 473 r->phase = NGX_HTTP_FIND_CONFIG_PHASE;
476 r->phase = NGX_HTTP_REWRITE_PHASE;
477 } 474 }
478 475
479 if (r->phase == NGX_HTTP_CONTENT_PHASE && r->content_handler) { 476 if (r->phase == NGX_HTTP_CONTENT_PHASE && r->content_handler) {
480 r->connection->write->event_handler = ngx_http_empty_handler; 477 r->connection->write->event_handler = ngx_http_empty_handler;
481 ngx_http_finalize_request(r, r->content_handler(r)); 478 ngx_http_finalize_request(r, r->content_handler(r));
523 } 520 }
524 } 521 }
525 522
526 /* no content handler was found */ 523 /* no content handler was found */
527 524
528 if (r->uri.data[r->uri.len - 1] == '/') { 525 if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) {
529 526
530 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 527 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
531 528
532 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 529 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
533 "directory index of \"%V%V\" is forbidden", 530 "directory index of \"%V%V\" is forbidden",
547 ngx_http_find_location_config(ngx_http_request_t *r) 544 ngx_http_find_location_config(ngx_http_request_t *r)
548 { 545 {
549 ngx_int_t rc; 546 ngx_int_t rc;
550 ngx_http_core_loc_conf_t *clcf; 547 ngx_http_core_loc_conf_t *clcf;
551 ngx_http_core_srv_conf_t *cscf; 548 ngx_http_core_srv_conf_t *cscf;
549
550 r->content_handler = NULL;
551 r->uri_changed = 0;
552 552
553 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); 553 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
554 554
555 rc = ngx_http_core_find_location(r, &cscf->locations, 0); 555 rc = ngx_http_core_find_location(r, &cscf->locations, 0);
556 556
952 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); 952 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
953 } 953 }
954 954
955 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); 955 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
956 r->loc_conf = cscf->ctx->loc_conf; 956 r->loc_conf = cscf->ctx->loc_conf;
957
958 r->phase = 0;
959 r->phase_handler = 0;
960 r->content_handler = NULL;
961 957
962 ngx_http_handler(r); 958 ngx_http_handler(r);
963 959
964 return NGX_DONE; 960 return NGX_DONE;
965 } 961 }