comparison src/http/ngx_http_request.c @ 394:e7a68e14ccd3

nginx-0.0.7-2004-07-16-10:33:35 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 16 Jul 2004 06:33:35 +0000
parents 5659d773cfa8
children f8f0f1834266
comparison
equal deleted inserted replaced
393:5659d773cfa8 394:e7a68e14ccd3
1421 { 1421 {
1422 ssize_t n; 1422 ssize_t n;
1423 ngx_connection_t *c; 1423 ngx_connection_t *c;
1424 ngx_http_log_ctx_t *ctx; 1424 ngx_http_log_ctx_t *ctx;
1425 1425
1426 c = (ngx_connection_t *) rev->data; 1426 c = rev->data;
1427 1427
1428 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http keepalive handler"); 1428 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http keepalive handler");
1429 1429
1430 if (rev->timedout) { 1430 if (rev->timedout) {
1431 ngx_http_close_connection(c); 1431 ngx_http_close_connection(c);
1723 1723
1724 return; 1724 return;
1725 } 1725 }
1726 1726
1727 1727
1728 #if (NGX_HTTP_SSL)
1729
1730 void ngx_ssl_close_handler(ngx_event_t *ev)
1731 {
1732 ngx_connection_t *c;
1733
1734 c = ev->data;
1735
1736 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ev->log, 0, "http ssl close handler");
1737
1738 if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
1739 return;
1740 }
1741
1742 ngx_http_close_connection(c);
1743 }
1744
1745 #endif
1746
1747
1728 void ngx_http_close_connection(ngx_connection_t *c) 1748 void ngx_http_close_connection(ngx_connection_t *c)
1729 { 1749 {
1730 ngx_socket_t fd; 1750 ngx_socket_t fd;
1731 1751
1732 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, 1752 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
1734 1754
1735 if (c->pool == NULL) { 1755 if (c->pool == NULL) {
1736 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed"); 1756 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed");
1737 return; 1757 return;
1738 } 1758 }
1759
1760 #if (NGX_HTTP_SSL)
1761
1762 if (c->ssl) {
1763 if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
1764 c->read->event_handler = ngx_ssl_close_handler;
1765 c->write->event_handler = ngx_ssl_close_handler;
1766 return;
1767 }
1768 }
1769
1770 #endif
1739 1771
1740 if (c->read->timer_set) { 1772 if (c->read->timer_set) {
1741 ngx_del_timer(c->read); 1773 ngx_del_timer(c->read);
1742 } 1774 }
1743 1775