left open sockets were not really tested

This commit is contained in:
Igor Sysoev 2008-02-28 20:31:33 +00:00
parent 7c4cf27aff
commit 02aa53be83
2 changed files with 6 additions and 5 deletions

View File

@ -136,6 +136,7 @@ struct ngx_event_s {
/* to test on worker exit */ /* to test on worker exit */
unsigned channel:1; unsigned channel:1;
unsigned resolver:1;
#if (NGX_THREADS) #if (NGX_THREADS)

View File

@ -994,18 +994,18 @@ ngx_worker_process_exit(ngx_cycle_t *cycle)
} }
} }
if (ngx_quit) { if (ngx_exiting) {
c = cycle->connections; c = cycle->connections;
for (i = 0; i < cycle->connection_n; i++) { for (i = 0; i < cycle->connection_n; i++) {
if (c[i].fd != -1 if (c[i].fd != -1
&& c[i].read && c[i].read
&& !c[i].read->accept && !c[i].read->accept
&& !c[i].read->channel) && !c[i].read->channel
&& !c[i].read->resolver)
{ {
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
"open socket #%d left in %ui connection, " "open socket #%d left in %ui connection %s",
"aborting", c[i].fd, i, ngx_debug_quit ? ", aborting" : "");
c[i].fd, i);
ngx_debug_point(); ngx_debug_point();
} }
} }