ソースを参照

Attempt to fix nginx upload module behavior that sends

a POST after the upload is finished, which fools our
tracker.
upload-fix
Brice Figureau 17年前
コミット
e863ac7928
1個のファイルの変更2行の追加2行の削除
  1. 2
    2
      ngx_http_uploadprogress_module.c

+ 2
- 2
ngx_http_uploadprogress_module.c ファイルの表示

@@ -365,8 +365,8 @@ static void ngx_http_uploadprogress_event_handler(ngx_http_request_t *r)
365 365
     if (up != NULL && !up->done) {
366 366
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
367 367
                        "upload-progress: read_event_handler found node: %V", id);
368
-        up->rest = r->request_body->rest;
369
-        up->length = r->headers_in.content_length_n;
368
+        up->rest = up->rest >= r->request_body->rest ? r->request_body->rest : up->res;
369
+        up->length = up->length == 0 ? r->headers_in.content_length_n : up->length;
370 370
         ngx_log_debug3(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
371 371
                        "upload-progress: read_event_handler storing rest %uO/%uO for %V", up->rest, up->length, id);
372 372
     } else {

読み込み中…
キャンセル
保存