Mercurial > hg > nginx
diff src/http/ngx_http_request.c @ 681:7e24168b0853 release-0.4.0
nginx-0.4.0-RELEASE import
*) Change in internal API: the HTTP modules initialization was moved
from the init module phase to the HTTP postconfiguration phase.
*) Change: now the request body is not read beforehand for the
ngx_http_perl_module: it's required to start the reading using the
$r->has_request_body method.
*) Feature: the ngx_http_perl_module supports the DECLINED return code.
*) Feature: the ngx_http_dav_module supports the incoming "Date" header
line for the PUT method.
*) Feature: the "ssi" directive is available inside the "if" block.
*) Bugfix: a segmentation fault occurred if there was an "index"
directive with variables and the first index name was without
variables; the bug had appeared in 0.1.29.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 30 Aug 2006 10:39:17 +0000 |
parents | e924670896ab |
children | d8d7c39e3a76 |
line wrap: on
line diff
--- a/src/http/ngx_http_request.c Mon Aug 28 16:57:48 2006 +0000 +++ b/src/http/ngx_http_request.c Wed Aug 30 10:39:17 2006 +0000 @@ -140,6 +140,9 @@ { ngx_string("Destination"), offsetof(ngx_http_headers_in_t, destination), ngx_http_process_header_line }, + + { ngx_string("Date"), offsetof(ngx_http_headers_in_t, date), + ngx_http_process_header_line }, #endif { ngx_string("Cookie"), 0, ngx_http_process_cookie }, @@ -933,9 +936,11 @@ { ssize_t n; ngx_event_t *rev; + ngx_connection_t *c; ngx_http_core_srv_conf_t *cscf; - rev = r->connection->read; + c = r->connection; + rev = c->read; n = r->header_in->last - r->header_in->pos; @@ -944,8 +949,8 @@ } if (rev->ready) { - n = r->connection->recv(r->connection, r->header_in->last, - r->header_in->end - r->header_in->last); + n = c->recv(c, r->header_in->last, + r->header_in->end - r->header_in->last); } else { n = NGX_AGAIN; } @@ -966,11 +971,14 @@ } if (n == 0) { - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, + ngx_log_error(NGX_LOG_INFO, c->log, 0, "client closed prematurely connection"); } if (n == 0 || n == NGX_ERROR) { + c->error = rev->error; + c->log->action = "sending response to client"; + ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); return NGX_ERROR; } @@ -1155,8 +1163,9 @@ } ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "client sent duplicate header line: \"%V: %V\"", - &h->key, &h->value); + "client sent duplicate header line: \"%V: %V\", " + "previous value: \"%V: %V\"", + &h->key, &h->value, &(*ph)->key, &(*ph)->value); ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); @@ -1460,6 +1469,13 @@ "http finalize request: %d, \"%V?%V\"", rc, &r->uri, &r->args); + if (rc == NGX_DECLINED) { + r->content_handler = NULL; + r->write_event_handler = ngx_http_core_run_phases; + ngx_http_core_run_phases(r); + return; + } + if (r != r->main && rc != NGX_ERROR && !r->connection->error