Nginx 1.1.15 removed the NGX_PARSE_LARGE_TIME error code.
The code checking this error is not used anymore, so let's remove
it.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Fix #7 - Error upload might be deleted from rbtree
Due to the done flag not being correctly set to 0 when the error
tracker triggers, it could happen that such upload could be mistakenly
removed from the the rbtree that contains all in-flight uploads.
Thanks to Theo Cushion for finding this issue.
Signed-off-by: Brice Figureau <brice@daysofwonder.com>
It could happen that when several keys produces the same hash that
find_node was not trying hard enough to traverse the rb tree.
Thanks to Markus Doppelbauer for his detailed bug report and test case.
Signed-off-by: Brice Figureau <brice@daysofwonder.com>
Support jsonp by storing the value of the callback parameter in $uploadprogress_callback.
Added an 'upload_progress_jsonp_output' directive that sets templates that work with jsonp.
Make jsonp parameter name configurable with the 'upload_progress_jsonp_parameter' directive.
Some uninitialized memory could lead to non array allocation in scripts,
leading to a segfault when reloading nginx.
Signed-off-by: Brice Figureau <brice@daysofwonder.com>
It was impossible to inherit the templates from an higher config level,
because the templates were overwritten when the config were merged.
Signed-off-by: Brice Figureau <brice@daysofwonder.com>
* global templates were not inited before their use
* relying on unpushed array made nelts == 0 and no array use
* code deduplication when initializing global templates
Signed-off-by: Brice Figureau <brice@daysofwonder.com>
Fix crash if a read event occur and the request args have been deleted
This could happen with the upload module if for a reason the upload
is aborted. In this case an internal redirect is done, but the request
still contains our read even handler.
Unfortunately the request args are nullified before calling this read
even handler. So we were crashing because we didn't check for id==null.
This patch fixes this issue.
Signed-off-by: Brice Figureau <brice@daysofwonder.com>
When we clean a node, we ask nginx to free the memory. On some
platform or no load there were great chance the memory wasn't
reused for something else.
With high load and on FreeBSD, the memory seems to be reused
immediatly and we jump in the middle of f*****g nowhere, and
we crash.
Thanks to Vladimir Getmanshchuk for his bug report.
Signed-off-by: Brice Figureau <brice@daysofwonder.com>