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>
* Added a content handler that overrides the original handler (but calls it). It is
used to add our own read_event_handler.
* Implemented a read_event_handler that calls the original handler, and store the rest/content_length in our
own node.
* modified the different handlers to use the new node fields