|
|
@@ -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 */
|