comparison src/http/ngx_http_request.c @ 60:df7d3fff122b NGINX_0_1_30

nginx 0.1.30 *) Bugfix: the worker process may got caught in an endless loop if the SSI was used. *) Bugfix: the response encrypted by SSL may not transferred complete. *) Bugfix: if the length of the response part received at once from proxied or FastCGI server was equal to 500, then nginx returns the 500 response code; in proxy mode the bug appeared in 0.1.29 only. *) Bugfix: nginx did not consider the directives with 8 or 9 parameters as invalid. *) Feature: the "return" directive can return the 204 response code. *) Feature: the "ignore_invalid_headers" directive.
author Igor Sysoev <http://sysoev.ru>
date Sat, 14 May 2005 00:00:00 +0400
parents b55cbf18157e
children 0790a8599248
comparison
equal deleted inserted replaced
59:4cb463ba8cce 60:df7d3fff122b
723 ngx_str_t header; 723 ngx_str_t header;
724 ngx_table_elt_t *h; 724 ngx_table_elt_t *h;
725 ngx_connection_t *c; 725 ngx_connection_t *c;
726 ngx_http_header_t *hh; 726 ngx_http_header_t *hh;
727 ngx_http_request_t *r; 727 ngx_http_request_t *r;
728 ngx_http_core_srv_conf_t *cscf;
728 ngx_http_core_main_conf_t *cmcf; 729 ngx_http_core_main_conf_t *cmcf;
729 730
730 c = rev->data; 731 c = rev->data;
731 r = c->data; 732 r = c->data;
732 733
740 ngx_http_close_connection(c); 741 ngx_http_close_connection(c);
741 return; 742 return;
742 } 743 }
743 744
744 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); 745 cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
746 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
745 hh = (ngx_http_header_t *) cmcf->headers_in_hash.buckets; 747 hh = (ngx_http_header_t *) cmcf->headers_in_hash.buckets;
746 748
747 rc = NGX_AGAIN; 749 rc = NGX_AGAIN;
748 750
749 for ( ;; ) { 751 for ( ;; ) {
781 783
782 rc = ngx_http_parse_header_line(r, r->header_in); 784 rc = ngx_http_parse_header_line(r, r->header_in);
783 785
784 if (rc == NGX_OK) { 786 if (rc == NGX_OK) {
785 787
786 #if 0 788 if (r->invalid_header && cscf->ignore_invalid_headers) {
787 if (r->invalid_header) {
788 789
789 /* there was error while a header line parsing */ 790 /* there was error while a header line parsing */
790 791
791 header.len = r->header_end - r->header_name_start; 792 header.len = r->header_end - r->header_name_start;
792 header.data = r->header_name_start; 793 header.data = r->header_name_start;
794 ngx_log_error(NGX_LOG_INFO, c->log, 0, 795 ngx_log_error(NGX_LOG_INFO, c->log, 0,
795 "client sent invalid header line: \"%V\"", 796 "client sent invalid header line: \"%V\"",
796 &header); 797 &header);
797 continue; 798 continue;
798 } 799 }
799 #endif
800 800
801 /* a header line has been parsed successfully */ 801 /* a header line has been parsed successfully */
802 802
803 h = ngx_list_push(&r->headers_in.headers); 803 h = ngx_list_push(&r->headers_in.headers);
804 if (h == NULL) { 804 if (h == NULL) {
1404 } 1404 }
1405 1405
1406 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1406 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1407 "http finalize request: %d, \"%V\"", rc, &r->uri); 1407 "http finalize request: %d, \"%V\"", rc, &r->uri);
1408 1408
1409 if (r->parent && rc >= NGX_HTTP_SPECIAL_RESPONSE) { 1409 if (r->parent
1410 && (rc >= NGX_HTTP_SPECIAL_RESPONSE || rc == NGX_HTTP_NO_CONTENT))
1411 {
1410 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); 1412 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
1411 return; 1413 return;
1412 } 1414 }
1413 1415
1414 if (r->parent || rc == NGX_AGAIN) { 1416 if (r->parent || rc == NGX_AGAIN) {
1448 } 1450 }
1449 1451
1450 return; 1452 return;
1451 } 1453 }
1452 1454
1453 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { 1455 if (rc >= NGX_HTTP_SPECIAL_RESPONSE || rc == NGX_HTTP_NO_CONTENT) {
1454 1456
1455 if (r->connection->read->timer_set) { 1457 if (r->connection->read->timer_set) {
1456 ngx_del_timer(r->connection->read); 1458 ngx_del_timer(r->connection->read);
1457 } 1459 }
1458 1460