Mercurial > hg > nginx-vendor-0-5
comparison src/http/ngx_http_request.c @ 24:420dd3f9e703 NGINX_0_1_12
nginx 0.1.12
*) Feature: the %request_length log parameter.
*) Bugfix: when using the /dev/poll, select and poll on the platforms,
where these methods may do the false reports, there may be the long
delay when the request was passed via the keep-alive connection. It
may be at least on Solaris when using the /dev/poll.
*) Bugfix: the send_lowat directive is ignored on Linux because Linux
does not support the SO_SNDLOWAT option.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 06 Dec 2004 00:00:00 +0300 |
parents | 8b6db3bda591 |
children | 45fe5b98a9de |
comparison
equal
deleted
inserted
replaced
23:5d37652cf26b | 24:420dd3f9e703 |
---|---|
792 | 792 |
793 /* a whole header has been parsed successfully */ | 793 /* a whole header has been parsed successfully */ |
794 | 794 |
795 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 795 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
796 "http header done"); | 796 "http header done"); |
797 | |
798 r->request_length += r->header_in->pos - r->header_in->start; | |
797 | 799 |
798 r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE; | 800 r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE; |
799 | 801 |
800 rc = ngx_http_process_request_header(r); | 802 rc = ngx_http_process_request_header(r); |
801 | 803 |
920 | 922 |
921 if (request_line && r->state == 0) { | 923 if (request_line && r->state == 0) { |
922 | 924 |
923 /* the client fills up the buffer with "\r\n" */ | 925 /* the client fills up the buffer with "\r\n" */ |
924 | 926 |
927 r->request_length += r->header_in->end - r->header_in->start; | |
928 | |
925 r->header_in->pos = r->header_in->start; | 929 r->header_in->pos = r->header_in->start; |
926 r->header_in->last = r->header_in->start; | 930 r->header_in->last = r->header_in->start; |
927 | 931 |
928 return NGX_OK; | 932 return NGX_OK; |
929 } | 933 } |
979 * r->state == 0 means that a header line was parsed successfully | 983 * r->state == 0 means that a header line was parsed successfully |
980 * and we do not need to copy incomplete header line and | 984 * and we do not need to copy incomplete header line and |
981 * to relocate the parser header pointers | 985 * to relocate the parser header pointers |
982 */ | 986 */ |
983 | 987 |
988 r->request_length += r->header_in->end - r->header_in->start; | |
989 | |
984 r->header_in = b; | 990 r->header_in = b; |
985 | 991 |
986 return NGX_OK; | 992 return NGX_OK; |
987 } | 993 } |
988 | 994 |
989 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 995 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
990 "http large header copy: %d", r->header_in->pos - old); | 996 "http large header copy: %d", r->header_in->pos - old); |
997 | |
998 r->request_length += old - r->header_in->start; | |
991 | 999 |
992 new = b->start; | 1000 new = b->start; |
993 | 1001 |
994 ngx_memcpy(new, old, r->header_in->pos - old); | 1002 ngx_memcpy(new, old, r->header_in->pos - old); |
995 | 1003 |
1808 | 1816 |
1809 n = c->recv(c, b->last, size); | 1817 n = c->recv(c, b->last, size); |
1810 c->log_error = NGX_ERROR_INFO; | 1818 c->log_error = NGX_ERROR_INFO; |
1811 | 1819 |
1812 if (n == NGX_AGAIN) { | 1820 if (n == NGX_AGAIN) { |
1821 if (ngx_handle_level_read_event(rev) == NGX_ERROR) { | |
1822 ngx_http_close_connection(c); | |
1823 } | |
1824 | |
1813 return; | 1825 return; |
1814 } | 1826 } |
1815 | 1827 |
1816 if (n == NGX_ERROR) { | 1828 if (n == NGX_ERROR) { |
1817 ngx_http_close_connection(c); | 1829 ngx_http_close_connection(c); |
1929 ngx_http_close_connection(c); | 1941 ngx_http_close_connection(c); |
1930 return; | 1942 return; |
1931 } | 1943 } |
1932 | 1944 |
1933 } while (rev->ready); | 1945 } while (rev->ready); |
1946 | |
1947 if (ngx_handle_level_read_event(rev) == NGX_ERROR) { | |
1948 ngx_http_close_connection(c); | |
1949 return; | |
1950 } | |
1934 | 1951 |
1935 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 1952 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
1936 | 1953 |
1937 timer *= 1000; | 1954 timer *= 1000; |
1938 | 1955 |