Bladeren bron

Merge 594f1233c3 into 463d60b502

pull/57/merge
Allan Jude 1 jaar geleden
bovenliggende
commit
289de71ce1
No account linked to committer's email address
1 gewijzigde bestanden met toevoegingen van 10 en 0 verwijderingen
  1. 10
    0
      ngx_http_uploadprogress_module.c

+ 10
- 0
ngx_http_uploadprogress_module.c Bestand weergeven

@@ -489,6 +489,16 @@ static void ngx_http_uploadprogress_event_handler(ngx_http_request_t *r)
489 489
     module_ctx = ngx_http_get_module_ctx(r, ngx_http_uploadprogress_module);
490 490
     if (module_ctx != NULL ) {
491 491
         module_ctx->read_event_handler(r);
492
+        /*
493
+         * Both ngx_http_v2_read_request_body() and
494
+         * ngx_http_v2_process_request_body() modify read_event_handler,
495
+         * we respect the change, but re-interpose our function so we still get
496
+         * future events, otherwise we miss all upload progress.
497
+         */
498
+        if (r->read_event_handler != ngx_http_uploadprogress_event_handler) {
499
+            module_ctx->read_event_handler = r->read_event_handler;
500
+            r->read_event_handler = ngx_http_uploadprogress_event_handler;
501
+        }
492 502
     }
493 503
 
494 504
     /* at this stage, r is not anymore safe to use */

Laden…
Annuleren
Opslaan