r1576, r1578, r1579 merge:

avoid segfault if poll is used and endless loop if select is used
This commit is contained in:
Igor Sysoev 2007-12-12 20:35:32 +00:00
parent ee84366663
commit 2e98f272c7
1 changed files with 1 additions and 12 deletions

View File

@ -1035,7 +1035,6 @@ static void
ngx_channel_handler(ngx_event_t *ev)
{
ngx_int_t n;
ngx_socket_t fd;
ngx_channel_t ch;
ngx_connection_t *c;
@ -1053,17 +1052,7 @@ ngx_channel_handler(ngx_event_t *ev)
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n);
if (n == NGX_ERROR) {
ngx_free_connection(c);
fd = c->fd;
c->fd = (ngx_socket_t) -1;
if (close(fd) == -1) {
ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
"close() channel failed");
}
ngx_close_connection(c);
return;
}