|
|
@@ -837,8 +837,8 @@ ngx_clean_old_connections(ngx_event_t * ev)
|
|
837
|
837
|
ngx_rbtree_delete(ctx->rbtree, node);
|
|
838
|
838
|
ngx_slab_free_locked(shpool, node);
|
|
839
|
839
|
}
|
|
840
|
|
-
|
|
841
|
|
- count++;
|
|
|
840
|
+ else
|
|
|
841
|
+ count++;
|
|
842
|
842
|
node = (ngx_rbtree_node_t *) up->prev;
|
|
843
|
843
|
}
|
|
844
|
844
|
|
|
|
@@ -846,15 +846,14 @@ ngx_clean_old_connections(ngx_event_t * ev)
|
|
846
|
846
|
"uploadprogress clean old connections: quit: %ui term: %ui count: %ui", ngx_quit, ngx_terminate, count);
|
|
847
|
847
|
|
|
848
|
848
|
/* don't reschedule timer if ngx_quit or ngx_terminate && nodes emtpy */
|
|
849
|
|
- if ( !(ngx_quit || ngx_terminate) && (ngx_rbtree_node_t *) ctx->list_tail.prev != &ctx->list_head.node ) {
|
|
|
849
|
+ if ( count > 0 || !(ngx_quit || ngx_terminate || ngx_exiting)) {
|
|
850
|
850
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
|
851
|
851
|
"uploadprogress clean old connections restarting timer");
|
|
852
|
852
|
ngx_add_timer(ev, TIMER_FREQUENCY); /* trigger again in 60s */
|
|
853
|
|
- } else {
|
|
|
853
|
+ } else if (ngx_quit || ngx_terminate || ngx_exiting) {
|
|
854
|
854
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
|
855
|
|
- "uploadprogress clean old connections quitting & no more active connections: not restarting timer");
|
|
|
855
|
+ "uploadprogress clean old connections quitting , no more active connections: not restarting timer");
|
|
856
|
856
|
}
|
|
857
|
|
-
|
|
858
|
857
|
ngx_shmtx_unlock(&shpool->mutex);
|
|
859
|
858
|
}
|
|
860
|
859
|
|