Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 2265:763c89919807
refactor log_subrequest
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 29 Sep 2008 13:18:41 +0000 |
parents | 440e8bfbc57e |
children | ce574b0ffeec |
comparison
equal
deleted
inserted
replaced
2264:440e8bfbc57e | 2265:763c89919807 |
---|---|
1758 | 1758 |
1759 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); | 1759 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); |
1760 return; | 1760 return; |
1761 } | 1761 } |
1762 | 1762 |
1763 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
1764 | |
1765 if (r != r->main && !r->logged) { | |
1766 | |
1767 if (clcf->log_subrequest) { | |
1768 ngx_http_log_request(r); | |
1769 } | |
1770 | |
1771 r->logged = 1; | |
1772 } | |
1773 | |
1763 if (r != r->main || rc == NGX_AGAIN) { | 1774 if (r != r->main || rc == NGX_AGAIN) { |
1764 if (ngx_http_set_write_handler(r) != NGX_OK) { | 1775 if (ngx_http_set_write_handler(r) != NGX_OK) { |
1765 return; | 1776 return; |
1766 } | 1777 } |
1767 } | 1778 } |
1773 "http finalize non-active request: \"%V?%V\"", | 1784 "http finalize non-active request: \"%V?%V\"", |
1774 &r->uri, &r->args); | 1785 &r->uri, &r->args); |
1775 return; | 1786 return; |
1776 } | 1787 } |
1777 | 1788 |
1778 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
1779 | |
1780 if (r != r->main) { | 1789 if (r != r->main) { |
1781 | 1790 |
1782 pr = r->parent; | 1791 pr = r->parent; |
1783 | 1792 |
1784 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, | 1793 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, |
1808 } | 1817 } |
1809 | 1818 |
1810 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, | 1819 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, |
1811 "http fast subrequest: \"%V?%V\" done", | 1820 "http fast subrequest: \"%V?%V\" done", |
1812 &r->uri, &r->args); | 1821 &r->uri, &r->args); |
1813 | |
1814 if (clcf->log_subrequest) { | |
1815 ngx_http_log_request(r); | |
1816 } | |
1817 | |
1818 return; | 1822 return; |
1819 } | 1823 } |
1820 | 1824 |
1821 if (rc != NGX_AGAIN) { | 1825 if (rc != NGX_AGAIN) { |
1822 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, | 1826 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, |
1823 "http wake parent request: \"%V?%V\"", | 1827 "http wake parent request: \"%V?%V\"", |
1824 &pr->uri, &pr->args); | 1828 &pr->uri, &pr->args); |
1825 | 1829 |
1826 if (clcf->log_subrequest) { | |
1827 ngx_http_log_request(r); | |
1828 } | |
1829 | |
1830 pr->write_event_handler(pr); | 1830 pr->write_event_handler(pr); |
1831 } | 1831 } |
1832 | |
1833 return; | |
1834 } | |
1835 | |
1836 if (clcf->log_subrequest) { | |
1837 ngx_http_log_request(r); | |
1838 } | 1832 } |
1839 | 1833 |
1840 return; | 1834 return; |
1841 } | 1835 } |
1842 | 1836 |