summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-12-12 20:35:32 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-12-12 20:35:32 +0000
commit67c3962364f8999e91c268d6840b1899a762b9ed (patch)
tree3eb4357c6b6f7aa129411da9ef9e2745e97ac8b4
parent4341d7949eaf333bba5e0c49ac85af1492974292 (diff)
downloadnginx-67c3962364f8999e91c268d6840b1899a762b9ed.tar.gz
nginx-67c3962364f8999e91c268d6840b1899a762b9ed.tar.bz2
r1576, r1578, r1579 merge:
avoid segfault if poll is used and endless loop if select is used
-rw-r--r--src/os/unix/ngx_process_cycle.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 3d198be8a..4705f3951 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -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;
}