diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-04-07 14:08:04 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-04-07 14:08:04 +0000 |
commit | 94e32ce7f885ecc648ae6377276f8813fc1c9347 (patch) | |
tree | 88da0722e206c60326b466b85ab118c00be13f55 /src/http/modules/perl | |
parent | 7469680c6c32901e7b6082a0e564430b587bbcfa (diff) | |
download | nginx-release-0.3.37.tar.gz nginx-release-0.3.37.zip |
nginx-0.3.37-RELEASE importrelease-0.3.37
*) Feature: the "limit_except" directive.
*) Feature: the "if" directive supports the "!~", "!~*", "-f", and
"!-f" operators.
*) Feature: the ngx_http_perl_module supports the $r->request_body
method.
*) Bugfix: in the ngx_http_addition_filter_module.
Diffstat (limited to 'src/http/modules/perl')
-rw-r--r-- | src/http/modules/perl/nginx.xs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs index d0453ea8d..7e2cec30e 100644 --- a/src/http/modules/perl/nginx.xs +++ b/src/http/modules/perl/nginx.xs @@ -261,6 +261,41 @@ header_in(r, key) RETVAL +SV * +request_body(r) + nginx r + + PREINIT: + + STRLEN len; + ngx_chain_t *cl; + + CODE: + + len = 0; + + for (cl = r->request_body->bufs; cl; cl = cl->next) { + if (cl->buf->in_file) { + XSRETURN_UNDEF; + } + + len += cl->buf->last - cl->buf->pos; + } + + if (len == 0) { + XSRETURN_UNDEF; + } + + RETVAL = newSV(len); + + for (cl = r->request_body->bufs; cl; cl = cl->next) { + sv_catpvn(RETVAL, cl->buf->pos, cl->buf->last - cl->buf->pos); + } + + OUTPUT: + RETVAL + + int header_out(r, key, value) nginx r |