Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/perl/nginx.xs')
-rw-r--r--src/http/modules/perl/nginx.xs35
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