diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-08-30 10:39:17 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-08-30 10:39:17 +0000 |
commit | da173abde0afa26b02c778d6475462ed487594c5 (patch) | |
tree | 25362ec56c889a2284e6feb341d5b87f13b5beab /src/http/modules/perl/nginx.xs | |
parent | 9cdd8a1cbcf70527db51eeab707a5bc05babdcf3 (diff) | |
download | nginx-release-0.4.0.tar.gz nginx-release-0.4.0.zip |
nginx-0.4.0-RELEASE importrelease-0.4.0
*) Change in internal API: the HTTP modules initialization was moved
from the init module phase to the HTTP postconfiguration phase.
*) Change: now the request body is not read beforehand for the
ngx_http_perl_module: it's required to start the reading using the
$r->has_request_body method.
*) Feature: the ngx_http_perl_module supports the DECLINED return code.
*) Feature: the ngx_http_dav_module supports the incoming "Date" header
line for the PUT method.
*) Feature: the "ssi" directive is available inside the "if" block.
*) Bugfix: a segmentation fault occurred if there was an "index"
directive with variables and the first index name was without
variables; the bug had appeared in 0.1.29.
Diffstat (limited to 'src/http/modules/perl/nginx.xs')
-rw-r--r-- | src/http/modules/perl/nginx.xs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs index 53b6a9230..6e6afed15 100644 --- a/src/http/modules/perl/nginx.xs +++ b/src/http/modules/perl/nginx.xs @@ -329,6 +329,42 @@ header_in(r, key) void +has_request_body(r, next) + CODE: + + dXSTARG; + ngx_http_request_t *r; + SV *next; + ngx_http_perl_ctx_t *ctx; + + ngx_http_perl_set_request(r); + + if (r->headers_in.content_length_n <= 0) { + XSRETURN_UNDEF; + } + + next = ST(1); + + ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module); + ctx->next = next; + + r->request_body_in_single_buf = 1; + r->request_body_in_persistent_file = 1; + r->request_body_delete_incomplete_file = 1; + + if (r->request_body_in_file_only) { + r->request_body_file_log_level = 0; + } + + ngx_http_read_client_request_body(r, ngx_http_perl_handle_request); + + sv_upgrade(TARG, SVt_IV); + sv_setiv(TARG, 1); + + ST(0) = TARG; + + +void request_body(r) CODE: |