Parcourir la source

Fix progress probe returning "done" when upload is still in progress.

This was due by reusing slabs from a terminated upload without reseting the
various parameters including the done parameter.
tags/v0.5
Brice Figureau il y a 18 ans
Parent
révision
1dd30303b2
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6
    2
      ngx_http_uploadprogress_module.c

+ 6
- 2
ngx_http_uploadprogress_module.c Voir le fichier

@@ -431,8 +431,8 @@ ngx_http_reportuploads_handler(ngx_http_request_t * r)
431 431
 
432 432
     up = find_node(id, ctx, r->connection->log);
433 433
     if (up != NULL) {
434
-        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
435
-                       "reportuploads found node: %V", id);
434
+        ngx_log_debug5(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
435
+                       "reportuploads found node: %V (rest: %uO, length: %uO, done: %ui, err_status: %ui)", id, up->rest, up->length, up->done, up->err_status);
436 436
         rest = up->rest;
437 437
         length = up->length;
438 438
         done = up->done;
@@ -676,6 +676,10 @@ ngx_http_uploadprogress_handler(ngx_http_request_t * r)
676 676
     node->key = hash;
677 677
     up->len = (u_char) id->len;
678 678
     up->err_status = r->err_status;
679
+    up->done = 0;
680
+    up->rest = 0;
681
+    up->length = 0;
682
+    up->timeout = 0;
679 683
 
680 684
     up->next = ctx->list_head.next;
681 685
     up->next->prev = up;

Chargement…
Annuler
Enregistrer