|
|
@@ -800,6 +800,7 @@ ngx_clean_old_connections(ngx_event_t * ev)
|
|
800
|
800
|
ngx_rbtree_node_t *node;
|
|
801
|
801
|
ngx_http_uploadprogress_node_t *up;
|
|
802
|
802
|
time_t now = ngx_time();
|
|
|
803
|
+ int count = 0;
|
|
803
|
804
|
|
|
804
|
805
|
|
|
805
|
806
|
/* scan the rbtree */
|
|
|
@@ -837,14 +838,22 @@ ngx_clean_old_connections(ngx_event_t * ev)
|
|
837
|
838
|
ngx_slab_free_locked(shpool, node);
|
|
838
|
839
|
}
|
|
839
|
840
|
|
|
|
841
|
+ count++;
|
|
840
|
842
|
node = (ngx_rbtree_node_t *) up->prev;
|
|
841
|
843
|
}
|
|
842
|
|
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
|
843
|
|
- "uploadprogress clean old connections restarting timer");
|
|
|
844
|
+
|
|
|
845
|
+ ngx_log_debug3(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
|
|
846
|
+ "uploadprogress clean old connections: quit: %ui term: %ui count: %ui", ngx_quit, ngx_terminate, count);
|
|
844
|
847
|
|
|
845
|
848
|
/* don't reschedule timer if ngx_quit or ngx_terminate && nodes emtpy */
|
|
846
|
|
- if ( !(ngx_quit || ngx_terminate) && (ngx_rbtree_node_t *) ctx->list_tail.prev != &ctx->list_head.node )
|
|
|
849
|
+ if ( !(ngx_quit || ngx_terminate) && (ngx_rbtree_node_t *) ctx->list_tail.prev != &ctx->list_head.node ) {
|
|
|
850
|
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
|
|
851
|
+ "uploadprogress clean old connections restarting timer");
|
|
847
|
852
|
ngx_add_timer(ev, TIMER_FREQUENCY); /* trigger again in 60s */
|
|
|
853
|
+ } else {
|
|
|
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");
|
|
|
856
|
+ }
|
|
848
|
857
|
|
|
849
|
858
|
ngx_shmtx_unlock(&shpool->mutex);
|
|
850
|
859
|
}
|