comparison src/http/ngx_http_request.c @ 298:4a3f18406832

nginx-0.0.3-2004-03-30-10:27:36 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 30 Mar 2004 06:27:36 +0000
parents 5cfd65b8b0a7
children 46b7eeb8a116
comparison
equal deleted inserted replaced
297:ee394e997c77 298:4a3f18406832
37 37
38 "client %s sent invalid header, URL: %s", 38 "client %s sent invalid header, URL: %s",
39 "client %s sent too long header line, URL: %s", 39 "client %s sent too long header line, URL: %s",
40 "client %s sent HTTP/1.1 request without \"Host\" header, URL: %s", 40 "client %s sent HTTP/1.1 request without \"Host\" header, URL: %s",
41 "client %s sent invalid \"Content-Length\" header, URL: %s" 41 "client %s sent invalid \"Content-Length\" header, URL: %s"
42 "client %s sent POST method without \"Content-Length\" header, URL: %s"
42 }; 43 };
43 44
44 45
45 #if 0 46 #if 0
46 static void ngx_http_dummy(ngx_event_t *wev) 47 static void ngx_http_dummy(ngx_event_t *wev)
871 if (r->headers_in.content_length_n == NGX_ERROR) { 872 if (r->headers_in.content_length_n == NGX_ERROR) {
872 return NGX_HTTP_PARSE_INVALID_CL_HEADER; 873 return NGX_HTTP_PARSE_INVALID_CL_HEADER;
873 } 874 }
874 } 875 }
875 876
877 if (r->method == NGX_HTTP_POST && r->headers_in.content_length_n <= 0) {
878 return NGX_HTTP_PARSE_POST_WO_CL_HEADER;
879 }
880
876 if (r->headers_in.connection) { 881 if (r->headers_in.connection) {
877 if (r->headers_in.connection->value.len == 5 882 if (r->headers_in.connection->value.len == 5
878 && ngx_strcasecmp(r->headers_in.connection->value.data, "close") 883 && ngx_strcasecmp(r->headers_in.connection->value.data, "close")
879 == 0) 884 == 0)
880 { 885 {
1220 1225
1221 h = c->buffer; 1226 h = c->buffer;
1222 wev = c->write; 1227 wev = c->write;
1223 wev->event_handler = ngx_http_empty_handler; 1228 wev->event_handler = ngx_http_empty_handler;
1224 1229
1230
1231 /* skip the tralling "\r\n" before the possible pipelined request */
1232
1233 while (h->pos < h->last && (*h->pos == CR || *h->pos == LF)) {
1234 h->pos++;
1235 }
1236
1225 if (h->pos < h->last) { 1237 if (h->pos < h->last) {
1226 1238
1227 /* 1239 /*
1228 * Pipelined request. 1240 * The pipelined request.
1229 * 1241 *
1230 * We do not know here whether the pipelined request is complete 1242 * We do not know here whether the pipelined request is complete
1231 * so if the large client headers are not enabled 1243 * so if the large client headers are not enabled
1232 * we need to copy the data to the start of c->buffer. 1244 * we need to copy the data to the start of c->buffer.
1233 * This copy should be rare because clients that support 1245 * This copy should be rare because clients that support