comparison src/http/ngx_http_request.c @ 276:c5c2b2883984 NGINX_0_5_8

nginx 0.5.8 *) Bugfix: a segmentation fault might occur if "client_body_in_file_only on" was used and a request body was small. *) Bugfix: a segmentation fault occurred if "client_body_in_file_only on" and "proxy_pass_request_body off" or "fastcgi_pass_request_body off" directives were used, and nginx switched to a next upstream. *) Bugfix: if the "proxy_buffering off" directive was used and a client connection was non-active, then the connection was closed after send timeout; bug appeared in 0.4.7. *) Bugfix: if the "epoll" method was used and a client closed a connection prematurely, then nginx closed the connection after a send timeout only. *) Bugfix: the "[alert] zero size buf" error when FastCGI server was used. *) Bugfixes in the "limit_zone" directive.
author Igor Sysoev <http://sysoev.ru>
date Fri, 19 Jan 2007 00:00:00 +0300
parents 29a6403156b0
children 675a39fd14cd
comparison
equal deleted inserted replaced
275:1779577cb845 276:c5c2b2883984
137 #if (NGX_HTTP_DAV) 137 #if (NGX_HTTP_DAV)
138 { ngx_string("Depth"), offsetof(ngx_http_headers_in_t, depth), 138 { ngx_string("Depth"), offsetof(ngx_http_headers_in_t, depth),
139 ngx_http_process_header_line }, 139 ngx_http_process_header_line },
140 140
141 { ngx_string("Destination"), offsetof(ngx_http_headers_in_t, destination), 141 { ngx_string("Destination"), offsetof(ngx_http_headers_in_t, destination),
142 ngx_http_process_header_line },
143
144 { ngx_string("Overwrite"), offsetof(ngx_http_headers_in_t, overwrite),
142 ngx_http_process_header_line }, 145 ngx_http_process_header_line },
143 146
144 { ngx_string("Date"), offsetof(ngx_http_headers_in_t, date), 147 { ngx_string("Date"), offsetof(ngx_http_headers_in_t, date),
145 ngx_http_process_header_line }, 148 ngx_http_process_header_line },
146 #endif 149 #endif
1760 1763
1761 1764
1762 static void 1765 static void
1763 ngx_http_block_read(ngx_http_request_t *r) 1766 ngx_http_block_read(ngx_http_request_t *r)
1764 { 1767 {
1765 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1768 int n;
1766 "http read blocked"); 1769 char buf[1];
1770 ngx_err_t err;
1771 ngx_event_t *rev;
1772 ngx_connection_t *c;
1773
1774 c = r->connection;
1775 rev = c->read;
1776
1777 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http read blocked");
1778
1779 #if (NGX_HAVE_KQUEUE)
1780
1781 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
1782
1783 if (!rev->pending_eof) {
1784 return;
1785 }
1786
1787 rev->eof = 1;
1788 c->error = 1;
1789 err = rev->kq_errno;
1790
1791 goto closed;
1792 }
1793
1794 #endif
1795
1796 n = recv(c->fd, buf, 1, MSG_PEEK);
1797
1798 if (n == 0) {
1799 rev->eof = 1;
1800 c->error = 1;
1801 err = 0;
1802
1803 goto closed;
1804
1805 } else if (n == -1) {
1806 err = ngx_socket_errno;
1807
1808 if (err != NGX_EAGAIN) {
1809 rev->eof = 1;
1810 c->error = 1;
1811
1812 goto closed;
1813 }
1814 }
1767 1815
1768 /* aio does not call this handler */ 1816 /* aio does not call this handler */
1769 1817
1770 if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) 1818 if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && rev->active) {
1771 && r->connection->read->active) 1819
1772 { 1820 if (ngx_del_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
1773 if (ngx_del_event(r->connection->read, NGX_READ_EVENT, 0)
1774 == NGX_ERROR)
1775 {
1776 ngx_http_close_request(r, 0); 1821 ngx_http_close_request(r, 0);
1777 } 1822 }
1778 } 1823 }
1824
1825 return;
1826
1827 closed:
1828
1829 if (err) {
1830 rev->error = 1;
1831 }
1832
1833 ngx_log_error(NGX_LOG_INFO, c->log, err,
1834 "client closed prematurely connection");
1835
1836 ngx_http_close_request(r, 0);
1837
1838 return;
1779 } 1839 }
1780 1840
1781 1841
1782 static void 1842 static void
1783 ngx_http_set_keepalive(ngx_http_request_t *r) 1843 ngx_http_set_keepalive(ngx_http_request_t *r)