Closed wbond closed 11 years ago
What do you mean by smaller files? Do you have any size I could check and test your patch with? What version of nginx were you using when testing?
3KB file seems to trigger it both with Firefox and Chrome when running locally.
I am running nginx 1.2.9.
I wasn't able to reproduce it on my dev machine (osx), but the code looked fine so I merged the pull request (and changed the comment style to match the rest of the code). Thanks!
When uploading smaller files (I noticed it especially apparent with Firefox connected to a local server), the progress module will never have the
ngx_http_uploadprogress_event_handler
function called, which means the length and remaining values are set.Because of this, calls to the progress endpoint will return
starting
even though the file has been fully uploaded and the request is now being processed by the handler. This is more obvious when the handler does some sort of processing such as resizing images or uploading files to another storage service.This patch will check the headers and amount of the request body that has been read when first initializing the upload in
ngx_http_uploadprogress_handler
, which means really small files will be properly reported.