comparison src/http/ngx_http_request.c @ 384:09b703ae3ba5 NGINX_0_6_36

nginx 0.6.36 *) Change: now the "Invalid argument" error returned by setsockopt(TCP_NODELAY) on Solaris, is ignored. *) Change: now POSTs without "Content-Length" header line are allowed. *) Feature: the "try_files" directive. *) Feature: the --with-pcre option in the configure. *) Feature: the "if_modified_since" directive. *) Feature: the "$cookie_..." variables. *) Feature: the "$arg_..." variables. *) Bugfix: compatibility with Tru64 UNIX. Thanks to Dustin Marquess. *) Bugfix: a "ssl_engine" directive did not use a SSL-accelerator for asymmetric ciphers. Thanks to Marcin Gozdalik. *) Bugfix: in a redirect rewrite directive original arguments were concatenated with new arguments by a "?" rather than an "&"; the bug had appeared in 0.1.18. Thanks to Maxim Dounin. *) Bugfix: nginx could not be built on AIX. *) Bugfix: a double response might be returned if the epoll or rtsig methods are used and a redirect was returned to a request with body. Thanks to Eden Li. *) Bugfix: a segmentation fault might occur in worker process if "resolver" directive was used in SMTP proxy. *) Bugfix: fastcgi_store stored files not always. *) Bugfix: nginx did not process a FastCGI server response, if the server send too many messages to stderr before response.
author Igor Sysoev <http://sysoev.ru>
date Thu, 02 Apr 2009 00:00:00 +0400
parents 3ce4580ae286
children 8815ae9c367b
comparison
equal deleted inserted replaced
383:3d40b0260a84 384:09b703ae3ba5
648 648
649 /* the request line has been parsed successfully */ 649 /* the request line has been parsed successfully */
650 650
651 r->request_line.len = r->request_end - r->request_start; 651 r->request_line.len = r->request_end - r->request_start;
652 r->request_line.data = r->request_start; 652 r->request_line.data = r->request_start;
653 *r->request_end = '\0';
653 654
654 655
655 if (r->args_start) { 656 if (r->args_start) {
656 r->uri.len = r->args_start - 1 - r->uri_start; 657 r->uri.len = r->args_start - 1 - r->uri_start;
657 } else { 658 } else {
1385 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED); 1386 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED);
1386 return NGX_ERROR; 1387 return NGX_ERROR;
1387 } 1388 }
1388 } 1389 }
1389 1390
1390 if (r->method & (NGX_HTTP_POST|NGX_HTTP_PUT) 1391 if (r->method & NGX_HTTP_PUT && r->headers_in.content_length_n == -1) {
1391 && r->headers_in.content_length_n == -1)
1392 {
1393 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, 1392 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
1394 "client sent %V method without \"Content-Length\" header", 1393 "client sent %V method without \"Content-Length\" header",
1395 &r->method_name); 1394 &r->method_name);
1396 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED); 1395 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED);
1397 return NGX_ERROR; 1396 return NGX_ERROR;
2089 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 2088 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
2090 2089
2091 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler"); 2090 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler");
2092 2091
2093 if (r->discard_body) { 2092 if (r->discard_body) {
2093 r->write_event_handler = ngx_http_request_empty_handler;
2094 r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000); 2094 r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000);
2095 ngx_add_timer(rev, clcf->lingering_timeout); 2095 ngx_add_timer(rev, clcf->lingering_timeout);
2096 return; 2096 return;
2097 } 2097 }
2098 2098
2262 2262
2263 if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY, 2263 if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
2264 (const void *) &tcp_nodelay, sizeof(int)) 2264 (const void *) &tcp_nodelay, sizeof(int))
2265 == -1) 2265 == -1)
2266 { 2266 {
2267 #if (NGX_SOLARIS)
2268 /* Solaris returns EINVAL if a socket has been shut down */
2269 c->log_error = NGX_ERROR_IGNORE_EINVAL;
2270 #endif
2271
2267 ngx_connection_error(c, ngx_socket_errno, 2272 ngx_connection_error(c, ngx_socket_errno,
2268 "setsockopt(TCP_NODELAY) failed"); 2273 "setsockopt(TCP_NODELAY) failed");
2274
2275 c->log_error = NGX_ERROR_INFO;
2269 ngx_http_close_connection(c); 2276 ngx_http_close_connection(c);
2270 return; 2277 return;
2271 } 2278 }
2272 2279
2273 c->tcp_nodelay = NGX_TCP_NODELAY_SET; 2280 c->tcp_nodelay = NGX_TCP_NODELAY_SET;