Преглед на файлове

Properly track progress of smaller file uploads

tags/v0.9.1
wbond преди 13 години
родител
ревизия
aa4e8b9355
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9
    0
      ngx_http_uploadprogress_module.c

+ 9
- 0
ngx_http_uploadprogress_module.c Целия файл

833
     up->length = 0;
833
     up->length = 0;
834
     up->timeout = 0;
834
     up->timeout = 0;
835
 
835
 
836
+    // Properly handles small files where no read events happen after the
837
+    // request is first handled
838
+    if (r->headers_in.content_length_n) {
839
+        up->length = r->headers_in.content_length_n;
840
+        if (r->request_body) {
841
+            up->rest = r->request_body->rest;
842
+        }
843
+    }
844
+
836
     up->next = ctx->list_head.next;
845
     up->next = ctx->list_head.next;
837
     up->next->prev = up;
846
     up->next->prev = up;
838
     up->prev = &ctx->list_head;
847
     up->prev = &ctx->list_head;

Loading…
Отказ
Запис