aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-03-30 06:27:36 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-03-30 06:27:36 +0000
commit6881bfb99063e3d42abaa313641b311c6fc3522d (patch)
tree1df669d89a2f58b450947901b1f41eb407dbf540 /src/http/ngx_http_request.c
parent11dbe97ca401221313dc233aa2d6f67dfcaef1a7 (diff)
downloadnginx-6881bfb99063e3d42abaa313641b311c6fc3522d.tar.gz
nginx-6881bfb99063e3d42abaa313641b311c6fc3522d.zip
nginx-0.0.3-2004-03-30-10:27:36 import
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 6562c8d52..86321b51b 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -39,6 +39,7 @@ static char *client_header_errors[] = {
"client %s sent too long header line, URL: %s",
"client %s sent HTTP/1.1 request without \"Host\" header, URL: %s",
"client %s sent invalid \"Content-Length\" header, URL: %s"
+ "client %s sent POST method without \"Content-Length\" header, URL: %s"
};
@@ -873,6 +874,10 @@ static ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r)
}
}
+ if (r->method == NGX_HTTP_POST && r->headers_in.content_length_n <= 0) {
+ return NGX_HTTP_PARSE_POST_WO_CL_HEADER;
+ }
+
if (r->headers_in.connection) {
if (r->headers_in.connection->value.len == 5
&& ngx_strcasecmp(r->headers_in.connection->value.data, "close")
@@ -1222,10 +1227,17 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r)
wev = c->write;
wev->event_handler = ngx_http_empty_handler;
+
+ /* skip the tralling "\r\n" before the possible pipelined request */
+
+ while (h->pos < h->last && (*h->pos == CR || *h->pos == LF)) {
+ h->pos++;
+ }
+
if (h->pos < h->last) {
/*
- * Pipelined request.
+ * The pipelined request.
*
* We do not know here whether the pipelined request is complete
* so if the large client headers are not enabled