summaryrefslogtreecommitdiff
path: root/src/http
diff options
context:
space:
mode:
authornginx <nginx@nginx.org>2013-04-24 14:11:57 +0000
committerJon Kolb <jon@b0g.us>2013-04-24 14:11:57 +0000
commit740eba7e73bf85fd7e93e2d908f64f649d1819ab (patch)
tree0c694118582bedb377359a58e879df444c583c89 /src/http
parent73a0d767d316125bc5b39609918d42521e14afdb (diff)
downloadnginx-740eba7e73bf85fd7e93e2d908f64f649d1819ab.tar.gz
Changes with nginx 1.4.0 24 Apr 2013v1.4.0
*) Bugfix: nginx could not be built with the ngx_http_perl_module if the --with-openssl option was used; the bug had appeared in 1.3.16. *) Bugfix: in a request body handling in the ngx_http_perl_module; the bug had appeared in 1.3.9.
Diffstat (limited to 'src/http')
-rw-r--r--src/http/modules/perl/Makefile.PL2
-rw-r--r--src/http/modules/perl/nginx.xs39
-rw-r--r--src/http/ngx_http_spdy.c1
3 files changed, 38 insertions, 4 deletions
diff --git a/src/http/modules/perl/Makefile.PL b/src/http/modules/perl/Makefile.PL
index ff8b2c634..03348b555 100644
--- a/src/http/modules/perl/Makefile.PL
+++ b/src/http/modules/perl/Makefile.PL
@@ -22,7 +22,7 @@ WriteMakefile(
depend => {
'nginx.c' => join(" ", map {
- "../../../../../$_"
+ m#^/# ? $_ : "../../../../../$_"
} (split(/\s+/, $ENV{NGX_DEPS}),
"src/http/modules/perl/ngx_http_perl_module.h"))
},
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs
index ed9743911..bbfef079c 100644
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -357,7 +357,7 @@ has_request_body(r, next)
ngx_http_perl_set_request(r);
- if (r->headers_in.content_length_n <= 0) {
+ if (r->headers_in.content_length_n <= 0 && !r->headers_in.chunked) {
XSRETURN_UNDEF;
}
@@ -386,7 +386,10 @@ request_body(r)
dXSTARG;
ngx_http_request_t *r;
+ u_char *p, *data;
size_t len;
+ ngx_buf_t *buf;
+ ngx_chain_t *cl;
ngx_http_perl_set_request(r);
@@ -397,13 +400,43 @@ request_body(r)
XSRETURN_UNDEF;
}
- len = r->request_body->bufs->buf->last - r->request_body->bufs->buf->pos;
+ cl = r->request_body->bufs;
+ buf = cl->buf;
+
+ if (cl->next == NULL) {
+ len = buf->last - buf->pos;
+ data = buf->pos;
+ goto done;
+ }
+
+ len = buf->last - buf->pos;
+ cl = cl->next;
+
+ for ( /* void */ ; cl; cl = cl->next) {
+ buf = cl->buf;
+ len += buf->last - buf->pos;
+ }
+
+ p = ngx_pnalloc(r->pool, len);
+ if (p == NULL) {
+ return XSRETURN_UNDEF;
+ }
+
+ data = p;
+ cl = r->request_body->bufs;
+
+ for ( /* void */ ; cl; cl = cl->next) {
+ buf = cl->buf;
+ p = ngx_cpymem(p, buf->pos, buf->last - buf->pos);
+ }
+
+ done:
if (len == 0) {
XSRETURN_UNDEF;
}
- ngx_http_perl_set_targ(r->request_body->bufs->buf->pos, len);
+ ngx_http_perl_set_targ(data, len);
ST(0) = TARG;
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c
index 0e6fe9281..3febc23e9 100644
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -1830,6 +1830,7 @@ ngx_http_spdy_create_stream(ngx_http_spdy_connection_t *sc, ngx_uint_t id,
fc->log = log;
fc->buffered = 0;
fc->sndlowat = 1;
+ fc->tcp_nodelay = NGX_TCP_NODELAY_DISABLED;
r = ngx_http_create_request(fc);
if (r == NULL) {