masterzen/nginx-upload-progress-module — pull request #34 by wbond (2013-06-19 12:54:56+00:00)
Title: Properly track progress of smaller file uploads

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.