|
|
@@ -833,6 +833,15 @@ ngx_http_uploadprogress_handler(ngx_http_request_t * r)
|
|
833
|
833
|
up->length = 0;
|
|
834
|
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
|
845
|
up->next = ctx->list_head.next;
|
|
837
|
846
|
up->next->prev = up;
|
|
838
|
847
|
up->prev = &ctx->list_head;
|