summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/perl (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2017-04-20Cleaned up r->headers_out.headers allocation error handling.Sergey Kandaurov1-0/+2
If initialization of a header failed for some reason after ngx_list_push(), leaving the header as is can result in uninitialized memory access by the header filter or the log module. The fix is to clear partially initialized headers in case of errors. For the Cache-Control header, the fix is to postpone pushing r->headers_out.cache_control until its value is completed.
2017-04-11Added support for the "308 Permanent Redirect" (ticket #877).Simon Leblanc1-0/+2
2017-04-02Moved handling of wev->delayed to the connection event handler.Maxim Dounin1-4/+1
With post_action or subrequests, it is possible that the timer set for wev->delayed will expire while the active subrequest write event handler is not ready to handle this. This results in request hangs as observed with limit_rate / sendfile_max_chunk and post_action (ticket #776) or subrequests (ticket #1228). Moving the handling to the connection event handler fixes the hangs observed, and also slightly simplifies the code.
2017-04-02Perl: fixed delaying subrequests.Maxim Dounin2-6/+11
Much like in limit_req, use the wev->delayed flag to ensure proper handling and interoperability with limit_rate.
2016-12-07Perl: added PERL_SET_INTERP().Maxim Dounin1-0/+8
For Perl compiled with threads, without PERL_SET_INTERP() the PL_curinterp remains set to the first interpreter created (that is, one created at original start). As a result after a reload Perl thinks that operations are done withing a thread, and, most notably, denies to change environment. For example, the following code properly works on original start, but fails after a reload: perl 'sub { my $r = shift; $r->send_http_header("text/plain"); $ENV{TZ} = "UTC"; $r->print("tz: " . $ENV{TZ} . " (localtime " . (localtime()) . ")\n"); $ENV{TZ} = "Europe/Moscow"; $r->print("tz: " . $ENV{TZ} . " (localtime " . (localtime()) . ")\n"); return OK; }'; To fix this, PERL_SET_INTERP() added anywhere where PERL_SET_CONTEXT() was previously used. Note that PERL_SET_INTERP() doesn't seem to be documented anywhere. Yet it is used in some other software, and also seems to be the only solution possible.
2016-11-01Perl: fixed optimization in SSI command handler.Maxim Dounin1-1/+1
As the pointer to the first argument was tested instead of the argument itself, array of arguments was always created, even if there were no arguments. Fix is to test args[0] instead of args. Found by Coverity (CID 1356862).
2016-09-20Perl: pass additional linker options to perl module.Konstantin Pavlov1-0/+2
Previously flags passed by --with-ld-opt were not used when building perl module, which meant hardening flags provided by package build systems were not applied.
2015-08-18Perl: prototyping behavior explicitly specified.Maxim Dounin1-0/+3
When prototyping behavior is not explicitly specified, xsubpp emits a message to stderr asking to do so (see ticket #608).
2015-08-18Perl: fixed warning about "sep" may be used uninitialized.Maxim Dounin1-9/+6
2014-06-19Perl: NULL-terminate argument list.Piotr Sikora1-1/+2
perl_parse() function expects argv/argc-style argument list, which according to the C standard must be NULL-terminated, that is: argv[argc] == NULL. This change fixes a crash (SIGSEGV) that could happen because of the buffer overrun during perl module initialization. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-09-04Handling of ngx_int_t != intptr_t case.Maxim Dounin1-2/+2
Casts between pointers and integers produce warnings on size mismatch. To silence them, cast to (u)intptr_t should be used. Prevoiusly, casts to ngx_(u)int_t were used in some cases, and several ngx_int_t expressions had no casts. As of now it's mostly style as ngx_int_t is defined as intptr_t.
2013-08-20Backed out f1a91825730a and 7094bd12c1ff.Maxim Dounin1-3/+1
While ngx_get_full_name() might have a bit more descriptive arguments, the ngx_conf_full_name() is generally easier to use when parsing configuration and limits exposure of cycle->prefix / cycle->conf_prefix details.
2013-08-06Replaced ngx_conf_full_name() with ngx_get_full_name().Valentin Bartenev1-1/+3
The ngx_get_full_name() function takes more readable arguments list.
2013-07-29Perl: fixed syntax usage for C preprocessor directives.Sergey Kandaurov1-7/+4
As per perlxs, C preprocessor directives should be at the first non-whitespace of a line to avoid interpreting them as comments. #if and #endif are moved so that there are no blank lines before them to retain them as part of the function body.
2013-06-10Perl: fixed r->header_in("Cookie") (ticket #351).Maxim Dounin1-9/+27
It was broken by X-Forwarded-For related changes in f7fe817c92a2 (1.3.14) as hh->offset is no longer 0 for Cookie.
2013-05-11Perl: extra "return" removed.Maxim Dounin1-1/+1
2013-04-23Perl: request body handling fixed.Maxim Dounin1-3/+36
As of 1.3.9, chunked request body may be available with r->headers_in.content_length_n <= 0. Additionally, request body may be in multiple buffers even if r->request_body_in_single_buf was requested.
2013-04-19Configure: fixed perl Makefile generation (ticket #334).Maxim Dounin1-1/+1
Dependancy tracking introduced in r5169 were not handled absolute path names properly. Absolute names might appear in CORE_DEPS if --with-openssl or --with-pcre configure arguments are used to build OpenSSL/PCRE libraries. Additionally, revert part of r5169 to set NGX_INCS from Makefile variables. Makefile variables have $ngx_include_opt in them, which might result in wrong include paths being used. As a side effect, this also restores build with --with-http_perl_module and --without-http at the same time.
2013-04-10Configure: fixed nginx.so rebuild (broken by r5145).Maxim Dounin1-2/+4
To avoid further breaks it's now done properly, all the dependencies are now passed to Makefile.PL. While here, fixed include list passed to Makefile.PL to use Makefile variables rather than a list expanded during configure.
2013-03-28Simplified nginx version maintenance.Ruslan Ermilov1-1/+1
It's no longer necessary to update src/http/modules/perl/nginx.pm when version is bumped, as it's now derived from src/core/nginx.h.
2013-03-27Version bump.Maxim Dounin1-1/+1
2013-03-07Version bump.Valentin Bartenev1-1/+1
2013-02-19Version bump.Valentin Bartenev1-1/+1
2013-02-07Version bump.Maxim Dounin1-1/+1
2013-01-17Version bump.Ruslan Ermilov1-1/+1
2012-12-26Version bump.Ruslan Ermilov1-1/+1
2012-12-20Brought the link to ngx_http_perl_module documentation up to date.Ruslan Ermilov1-1/+1
2012-12-17Added checks that disallow adding a variable with an empty name.Ruslan Ermilov1-1/+1
Added variable name syntax checks to "geo" and "map" directives.
2012-12-13Fixed variable syntax checking in "set", "geo", "limit_conn_zone",Ruslan Ermilov1-1/+1
and "perl_set" directives.
2012-12-03Fixed build with embedded perl in certain setups (ticket #48).Ruslan Ermilov1-14/+3
2012-11-29Version bump.Maxim Dounin1-1/+1
2012-11-16Version bump.Ruslan Ermilov1-1/+1
2012-10-03Version bump.Maxim Dounin1-1/+1
2012-09-26Version bump.Maxim Dounin1-1/+1
2012-08-27Version bump.Ruslan Ermilov1-1/+1
2012-07-31Version bump.Ruslan Ermilov1-1/+1
2012-07-17Version bump.Ruslan Ermilov1-1/+1
2012-06-29Version bump.Ruslan Ermilov1-1/+1
2012-06-18Version bump.Ruslan Ermilov1-1/+1
2012-05-23Fixed warning during nginx.xs compilation.Maxim Dounin1-1/+1
2012-05-16Version bump.Ruslan Ermilov1-1/+1
2012-04-26Version bump.Maxim Dounin1-1/+1
2012-04-23Version bump.Maxim Dounin1-1/+1
2012-04-12Version bump.Maxim Dounin1-1/+1
2012-04-02Version bump.Maxim Dounin1-1/+1
2012-03-15Version bump.Maxim Dounin1-1/+1
2012-03-05Version bump.Maxim Dounin1-1/+1
2012-02-27Disable symlinks: initialization of the "disable_symlinks" field inValentin Bartenev1-3/+4
ngx_open_file_info_t moved to a separate function. This is preparation for the "from=" parameter implementation of the "disable_symlinks" directive.
2012-02-27Added support for the 307 Temporary Redirect.Ruslan Ermilov1-0/+4
2012-02-20Version bump.Maxim Dounin1-1/+1