Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 1500:c9c4e96421f1 stable-0.5
r1284 merge:
proxy_ignore_client_abort, fastcgi_ignore_client_abort, and so on were
broken by r1111
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 22 Sep 2007 18:31:26 +0000 |
parents | 754f3648642d |
children | bb61a910e832 |
comparison
equal
deleted
inserted
replaced
1449:5f79db696606 | 1500:c9c4e96421f1 |
---|---|
32 static void ngx_http_request_handler(ngx_event_t *ev); | 32 static void ngx_http_request_handler(ngx_event_t *ev); |
33 static ngx_int_t ngx_http_set_write_handler(ngx_http_request_t *r); | 33 static ngx_int_t ngx_http_set_write_handler(ngx_http_request_t *r); |
34 static void ngx_http_writer(ngx_http_request_t *r); | 34 static void ngx_http_writer(ngx_http_request_t *r); |
35 | 35 |
36 static void ngx_http_block_read(ngx_http_request_t *r); | 36 static void ngx_http_block_read(ngx_http_request_t *r); |
37 static void ngx_http_test_read(ngx_http_request_t *r); | |
37 static void ngx_http_set_keepalive(ngx_http_request_t *r); | 38 static void ngx_http_set_keepalive(ngx_http_request_t *r); |
38 static void ngx_http_keepalive_handler(ngx_event_t *ev); | 39 static void ngx_http_keepalive_handler(ngx_event_t *ev); |
39 static void ngx_http_set_lingering_close(ngx_http_request_t *r); | 40 static void ngx_http_set_lingering_close(ngx_http_request_t *r); |
40 static void ngx_http_lingering_close_handler(ngx_event_t *ev); | 41 static void ngx_http_lingering_close_handler(ngx_event_t *ev); |
41 static ngx_int_t ngx_http_post_action(ngx_http_request_t *r); | 42 static ngx_int_t ngx_http_post_action(ngx_http_request_t *r); |
1708 ngx_event_t *wev; | 1709 ngx_event_t *wev; |
1709 ngx_http_core_loc_conf_t *clcf; | 1710 ngx_http_core_loc_conf_t *clcf; |
1710 | 1711 |
1711 r->http_state = NGX_HTTP_WRITING_REQUEST_STATE; | 1712 r->http_state = NGX_HTTP_WRITING_REQUEST_STATE; |
1712 | 1713 |
1713 r->read_event_handler = ngx_http_block_read; | 1714 r->read_event_handler = ngx_http_test_read; |
1714 r->write_event_handler = ngx_http_writer; | 1715 r->write_event_handler = ngx_http_writer; |
1715 | 1716 |
1716 wev = r->connection->write; | 1717 wev = r->connection->write; |
1717 | 1718 |
1718 if (wev->ready && wev->delayed) { | 1719 if (wev->ready && wev->delayed) { |
1821 | 1822 |
1822 | 1823 |
1823 static void | 1824 static void |
1824 ngx_http_block_read(ngx_http_request_t *r) | 1825 ngx_http_block_read(ngx_http_request_t *r) |
1825 { | 1826 { |
1827 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
1828 "http read blocked"); | |
1829 | |
1830 /* aio does not call this handler */ | |
1831 | |
1832 if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) | |
1833 && r->connection->read->active) | |
1834 { | |
1835 if (ngx_del_event(r->connection->read, NGX_READ_EVENT, 0) | |
1836 == NGX_ERROR) | |
1837 { | |
1838 ngx_http_close_request(r, 0); | |
1839 } | |
1840 } | |
1841 } | |
1842 | |
1843 | |
1844 static void | |
1845 ngx_http_test_read(ngx_http_request_t *r) | |
1846 { | |
1826 int n; | 1847 int n; |
1827 char buf[1]; | 1848 char buf[1]; |
1828 ngx_err_t err; | 1849 ngx_err_t err; |
1829 ngx_event_t *rev; | 1850 ngx_event_t *rev; |
1830 ngx_connection_t *c; | 1851 ngx_connection_t *c; |
1831 | 1852 |
1832 c = r->connection; | 1853 c = r->connection; |
1833 rev = c->read; | 1854 rev = c->read; |
1834 | 1855 |
1835 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http read blocked"); | 1856 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http test read"); |
1836 | 1857 |
1837 #if (NGX_HAVE_KQUEUE) | 1858 #if (NGX_HAVE_KQUEUE) |
1838 | 1859 |
1839 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { | 1860 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { |
1840 | 1861 |