Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 1368:202cae9a0c2b
rename ngx_http_block_read() and ngx_http_test_read() to ..._reading()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 06 Aug 2007 15:22:40 +0000 |
parents | a3f8d6d17b94 |
children | fdea12ffb24a |
comparison
equal
deleted
inserted
replaced
1367:aa700583b57d | 1368:202cae9a0c2b |
---|---|
31 | 31 |
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_test_reading(ngx_http_request_t *r); |
37 static void ngx_http_test_read(ngx_http_request_t *r); | |
38 static void ngx_http_set_keepalive(ngx_http_request_t *r); | 37 static void ngx_http_set_keepalive(ngx_http_request_t *r); |
39 static void ngx_http_keepalive_handler(ngx_event_t *ev); | 38 static void ngx_http_keepalive_handler(ngx_event_t *ev); |
40 static void ngx_http_set_lingering_close(ngx_http_request_t *r); | 39 static void ngx_http_set_lingering_close(ngx_http_request_t *r); |
41 static void ngx_http_lingering_close_handler(ngx_event_t *ev); | 40 static void ngx_http_lingering_close_handler(ngx_event_t *ev); |
42 static ngx_int_t ngx_http_post_action(ngx_http_request_t *r); | 41 static ngx_int_t ngx_http_post_action(ngx_http_request_t *r); |
1440 r->stat_writing = 1; | 1439 r->stat_writing = 1; |
1441 #endif | 1440 #endif |
1442 | 1441 |
1443 c->read->handler = ngx_http_request_handler; | 1442 c->read->handler = ngx_http_request_handler; |
1444 c->write->handler = ngx_http_request_handler; | 1443 c->write->handler = ngx_http_request_handler; |
1445 r->read_event_handler = ngx_http_block_read; | 1444 r->read_event_handler = ngx_http_block_reading; |
1446 | 1445 |
1447 ngx_http_handler(r); | 1446 ngx_http_handler(r); |
1448 | 1447 |
1449 return; | 1448 return; |
1450 } | 1449 } |
1700 ngx_event_t *wev; | 1699 ngx_event_t *wev; |
1701 ngx_http_core_loc_conf_t *clcf; | 1700 ngx_http_core_loc_conf_t *clcf; |
1702 | 1701 |
1703 r->http_state = NGX_HTTP_WRITING_REQUEST_STATE; | 1702 r->http_state = NGX_HTTP_WRITING_REQUEST_STATE; |
1704 | 1703 |
1705 r->read_event_handler = ngx_http_test_read; | 1704 r->read_event_handler = ngx_http_test_reading; |
1706 r->write_event_handler = ngx_http_writer; | 1705 r->write_event_handler = ngx_http_writer; |
1707 | 1706 |
1708 wev = r->connection->write; | 1707 wev = r->connection->write; |
1709 | 1708 |
1710 if (wev->ready && wev->delayed) { | 1709 if (wev->ready && wev->delayed) { |
1810 | 1809 |
1811 ngx_http_finalize_request(r, rc); | 1810 ngx_http_finalize_request(r, rc); |
1812 } | 1811 } |
1813 | 1812 |
1814 | 1813 |
1815 static void | 1814 void |
1816 ngx_http_block_read(ngx_http_request_t *r) | 1815 ngx_http_block_reading(ngx_http_request_t *r) |
1817 { | 1816 { |
1818 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 1817 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1819 "http read blocked"); | 1818 "http reading blocked"); |
1820 | 1819 |
1821 /* aio does not call this handler */ | 1820 /* aio does not call this handler */ |
1822 | 1821 |
1823 if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) | 1822 if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) |
1824 && r->connection->read->active) | 1823 && r->connection->read->active) |
1831 } | 1830 } |
1832 } | 1831 } |
1833 | 1832 |
1834 | 1833 |
1835 static void | 1834 static void |
1836 ngx_http_test_read(ngx_http_request_t *r) | 1835 ngx_http_test_reading(ngx_http_request_t *r) |
1837 { | 1836 { |
1838 int n; | 1837 int n; |
1839 char buf[1]; | 1838 char buf[1]; |
1840 ngx_err_t err; | 1839 ngx_err_t err; |
1841 ngx_event_t *rev; | 1840 ngx_event_t *rev; |
1842 ngx_connection_t *c; | 1841 ngx_connection_t *c; |
1843 | 1842 |
1844 c = r->connection; | 1843 c = r->connection; |
1845 rev = c->read; | 1844 rev = c->read; |
1846 | 1845 |
1847 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http test read"); | 1846 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http test reading"); |
1848 | 1847 |
1849 #if (NGX_HAVE_KQUEUE) | 1848 #if (NGX_HAVE_KQUEUE) |
1850 | 1849 |
1851 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { | 1850 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { |
1852 | 1851 |
2379 | 2378 |
2380 r->http_version = NGX_HTTP_VERSION_9; | 2379 r->http_version = NGX_HTTP_VERSION_9; |
2381 r->header_only = 1; | 2380 r->header_only = 1; |
2382 r->post_action = 1; | 2381 r->post_action = 1; |
2383 | 2382 |
2384 r->read_event_handler = ngx_http_block_read; | 2383 r->read_event_handler = ngx_http_block_reading; |
2385 | 2384 |
2386 ngx_http_internal_redirect(r, &clcf->post_action, NULL); | 2385 ngx_http_internal_redirect(r, &clcf->post_action, NULL); |
2387 | 2386 |
2388 return NGX_OK; | 2387 return NGX_OK; |
2389 } | 2388 } |