|
|
@@ -462,6 +462,9 @@ static void ngx_http_uploadprogress_event_handler(ngx_http_request_t *r)
|
|
462
|
462
|
ngx_http_uploadprogress_node_t *up;
|
|
463
|
463
|
ngx_http_uploadprogress_conf_t *upcf;
|
|
464
|
464
|
ngx_http_uploadprogress_module_ctx_t *module_ctx;
|
|
|
465
|
+ size_t size;
|
|
|
466
|
+ off_t rest;
|
|
|
467
|
+
|
|
465
|
468
|
|
|
466
|
469
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upload-progress: ngx_http_uploadprogress_event_handler");
|
|
467
|
470
|
|
|
|
@@ -517,7 +520,15 @@ static void ngx_http_uploadprogress_event_handler(ngx_http_request_t *r)
|
|
517
|
520
|
if (up != NULL && !up->done) {
|
|
518
|
521
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
|
|
519
|
522
|
"upload-progress: read_event_handler found node: %V", id);
|
|
520
|
|
- up->rest = r->request_body->rest;
|
|
|
523
|
+ rest = r->request_body->rest;
|
|
|
524
|
+ size = r->request_body->buf->last - r->request_body->buf->pos;
|
|
|
525
|
+ if ((off_t) size < rest) {
|
|
|
526
|
+ rest -= size;
|
|
|
527
|
+ } else {
|
|
|
528
|
+ rest = 0;
|
|
|
529
|
+ }
|
|
|
530
|
+
|
|
|
531
|
+ up->rest = rest;
|
|
521
|
532
|
if(up->length == 0)
|
|
522
|
533
|
up->length = r->headers_in.content_length_n;
|
|
523
|
534
|
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
|