Mercurial > hg > nginx-quic
comparison src/http/ngx_http_core_module.c @ 657:400711951595 release-0.3.50
nginx-0.3.50-RELEASE import
*) Change: the "proxy_redirect_errors" and "fastcgi_redirect_errors"
directives was renamed to the "proxy_intercept_errors" and
"fastcgi_intercept_errors" directives.
*) Feature: the ngx_http_charset_module supports the recoding from the
single byte encodings to the UTF-8 encoding and back.
*) Feature: the "X-Accel-Charset" response header line is supported in
proxy and FastCGI mode.
*) Bugfix: the "\" escape symbol in the "\"" and "\'" pairs in the SSI
command was removed only if the command also has the "$" symbol.
*) Bugfix: the "<!--" string might be added on some conditions in the
SSI after inclusion.
*) Bugfix: if the "Content-Length: 0" header line was in response, then
in nonbuffered proxying mode the client connection was not closed.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 28 Jun 2006 16:00:26 +0000 |
parents | 7cbef16c71a1 |
children | 6d5c1535bb9d |
comparison
equal
deleted
inserted
replaced
656:97f36f8e65dd | 657:400711951595 |
---|---|
517 | 517 |
518 static void | 518 static void |
519 ngx_http_core_run_phases(ngx_http_request_t *r) | 519 ngx_http_core_run_phases(ngx_http_request_t *r) |
520 { | 520 { |
521 ngx_int_t rc; | 521 ngx_int_t rc; |
522 ngx_str_t path; | |
522 ngx_http_handler_pt *h; | 523 ngx_http_handler_pt *h; |
523 ngx_http_core_loc_conf_t *clcf; | 524 ngx_http_core_loc_conf_t *clcf; |
524 ngx_http_core_main_conf_t *cmcf; | 525 ngx_http_core_main_conf_t *cmcf; |
525 | 526 |
526 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 527 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
640 | 641 |
641 /* no content handler was found */ | 642 /* no content handler was found */ |
642 | 643 |
643 if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) { | 644 if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) { |
644 | 645 |
645 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 646 if (ngx_http_map_uri_to_path(r, &path, 0) != NULL) { |
646 | 647 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
647 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | 648 "directory index of \"%V\" is forbidden", &path); |
648 "directory index of \"%V%V\" is forbidden", | 649 } |
649 &clcf->root, &r->uri); | |
650 | 650 |
651 ngx_http_finalize_request(r, NGX_HTTP_FORBIDDEN); | 651 ngx_http_finalize_request(r, NGX_HTTP_FORBIDDEN); |
652 return; | 652 return; |
653 } | 653 } |
654 | 654 |
958 | 958 |
959 type = ngx_hash_find(&clcf->types_hash, hash, | 959 type = ngx_hash_find(&clcf->types_hash, hash, |
960 r->exten.data, r->exten.len); | 960 r->exten.data, r->exten.len); |
961 | 961 |
962 if (type) { | 962 if (type) { |
963 r->headers_out.content_type_len = type->len; | |
963 r->headers_out.content_type = *type; | 964 r->headers_out.content_type = *type; |
965 | |
964 return NGX_OK; | 966 return NGX_OK; |
965 } | 967 } |
966 } | 968 } |
967 | 969 |
970 r->headers_out.content_type_len = clcf->default_type.len; | |
968 r->headers_out.content_type = clcf->default_type; | 971 r->headers_out.content_type = clcf->default_type; |
969 | 972 |
970 return NGX_OK; | 973 return NGX_OK; |
971 } | 974 } |
972 | 975 |
1153 { | 1156 { |
1154 ngx_connection_t *c; | 1157 ngx_connection_t *c; |
1155 ngx_http_request_t *sr; | 1158 ngx_http_request_t *sr; |
1156 ngx_http_core_srv_conf_t *cscf; | 1159 ngx_http_core_srv_conf_t *cscf; |
1157 ngx_http_postponed_request_t *pr, *p; | 1160 ngx_http_postponed_request_t *pr, *p; |
1161 | |
1162 r->main->subrequests--; | |
1163 | |
1164 if (r->main->subrequests == 0) { | |
1165 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
1166 "subrequests cycle"); | |
1167 return NGX_ERROR; | |
1168 } | |
1158 | 1169 |
1159 sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t)); | 1170 sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t)); |
1160 if (sr == NULL) { | 1171 if (sr == NULL) { |
1161 return NGX_ERROR; | 1172 return NGX_ERROR; |
1162 } | 1173 } |