diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-06-28 16:00:26 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-06-28 16:00:26 +0000 |
commit | ef809b86c36a9584a15df6caac2eb727ceacc10d (patch) | |
tree | 80dc756ea197b259b159fb9a47b09df1a1eae7f1 /src/http/ngx_http_core_module.c | |
parent | f115ebe9c3d57c0b271b03ed931ff42cdef37eb2 (diff) | |
download | nginx-release-0.3.50.tar.gz nginx-release-0.3.50.zip |
nginx-0.3.50-RELEASE importrelease-0.3.50
*) 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.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index f08ec458d..ca963abe4 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -519,6 +519,7 @@ static void ngx_http_core_run_phases(ngx_http_request_t *r) { ngx_int_t rc; + ngx_str_t path; ngx_http_handler_pt *h; ngx_http_core_loc_conf_t *clcf; ngx_http_core_main_conf_t *cmcf; @@ -642,11 +643,10 @@ ngx_http_core_run_phases(ngx_http_request_t *r) if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) { - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "directory index of \"%V%V\" is forbidden", - &clcf->root, &r->uri); + if (ngx_http_map_uri_to_path(r, &path, 0) != NULL) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "directory index of \"%V\" is forbidden", &path); + } ngx_http_finalize_request(r, NGX_HTTP_FORBIDDEN); return; @@ -960,11 +960,14 @@ ngx_http_set_content_type(ngx_http_request_t *r) r->exten.data, r->exten.len); if (type) { + r->headers_out.content_type_len = type->len; r->headers_out.content_type = *type; + return NGX_OK; } } + r->headers_out.content_type_len = clcf->default_type.len; r->headers_out.content_type = clcf->default_type; return NGX_OK; @@ -1156,6 +1159,14 @@ ngx_http_subrequest(ngx_http_request_t *r, ngx_http_core_srv_conf_t *cscf; ngx_http_postponed_request_t *pr, *p; + r->main->subrequests--; + + if (r->main->subrequests == 0) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "subrequests cycle"); + return NGX_ERROR; + } + sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t)); if (sr == NULL) { return NGX_ERROR; |