From bb7c84159f948bb95836d6a54c1046457c44df18 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 19 Feb 2008 16:30:54 +0000 Subject: [PATCH] avoid endless loop if epoll is used --- src/os/unix/ngx_process_cycle.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index aa95e81d9..96387f04a 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -1059,6 +1059,11 @@ ngx_channel_handler(ngx_event_t *ev) ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n); if (n == NGX_ERROR) { + + if (ngx_event_flags & NGX_USE_EPOLL_EVENT) { + ngx_del_conn(c, 0); + } + ngx_close_connection(c); return; }