~titusx/nginx/module-upload-progress

Viewing all changes in revision 75.

  • Committer: Brice Figureau
  • Date: 2014-05-16 21:25:39 UTC
  • Revision ID: git-v1:39e4d539874dc3083c0d422ad175f1a330809cec
Tags: v0.9.1
fix #36 - nginx reduces rquest_body->rest only on buffer recycling

Since nginx 1.3.9, the request body handler is able to decode chunked
encoding. This feature changed the behavior of the request body handler,
whereas before the request_body->rest was decremented on each call to
recv and the upload progress module was showing the correct rest
decrement. Now, request_body->rest is only decremented when the incoming
body buffer is reused. If this buffer is large (it's size depends on
client_body_buffer_size), then it can never be reused, thus the rest
field is never decremented until the end of the file.

This hasn't been detected and reproduced before, because I happen to
run the tests with small client_body_buffer_size (ie less than 10% from
the file uploaded).

The solution is to never use rest, but compute the correct rest by
tracking the current buffer size.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: