comparison src/http/ngx_http_request.c @ 374:213f17e9f776

nginx-0.0.7-2004-07-02-09:47:00 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 02 Jul 2004 05:47:00 +0000
parents c9fdfccebc49
children 744ccb59062d
comparison
equal deleted inserted replaced
373:018569a8f09c 374:213f17e9f776
1737 if (c->write->active || c->write->posted || c->write->disabled) { 1737 if (c->write->active || c->write->posted || c->write->disabled) {
1738 ngx_del_event(c->write, NGX_WRITE_EVENT, NGX_CLOSE_EVENT); 1738 ngx_del_event(c->write, NGX_WRITE_EVENT, NGX_CLOSE_EVENT);
1739 } 1739 }
1740 } 1740 }
1741 1741
1742 /*
1743 * we have to clean the connection information before the closing
1744 * because another thread may reopen the same file descriptor
1745 * before we clean the connection
1746 */
1747
1742 fd = c->fd; 1748 fd = c->fd;
1743
1744 c->fd = (ngx_socket_t) -1; 1749 c->fd = (ngx_socket_t) -1;
1745 c->data = NULL; 1750 c->data = NULL;
1746 ngx_destroy_pool(c->pool); 1751 ngx_destroy_pool(c->pool);
1747 1752
1748 /* 1753 #if (NGX_THREADS)
1749 * we has to clean the connection before the closing because another thread 1754
1750 * may reopen the same file descriptor before we clean the connection 1755 if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_OK) {
1751 */ 1756 ngx_unlock(&c->lock);
1757 c->read->locked = 0;
1758 c->write->locked = 0;
1759
1760 ngx_mutex_unlock(ngx_posted_events_mutex);
1761 }
1762
1763 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
1764 "connection lock: %d " PTR_FMT, c->lock, &c->lock);
1765
1766 #endif
1752 1767
1753 if (ngx_close_socket(fd) == -1) { 1768 if (ngx_close_socket(fd) == -1) {
1754 1769
1755 /* we use ngx_cycle->log because c->log was in c->pool */ 1770 /* we use ngx_cycle->log because c->log was in c->pool */
1756 1771