mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
bd9c04d74f | |||
91140f3f06 | |||
b8be9ddfa7 | |||
b0cfa8da4f | |||
246333133a | |||
5063f4f8d1 | |||
b76e2f4c9a | |||
b626ebf54b | |||
479d89e951 | |||
429ff5b3b5 | |||
f42b061473 | |||
876b1eca48 | |||
25d7c1e91b | |||
c239151bf7 | |||
67879a5fbb | |||
170cc51fe2 | |||
7c22476c97 |
117
patches/nginx-1.0.8-allow_request_body_updating.patch
Normal file
117
patches/nginx-1.0.8-allow_request_body_updating.patch
Normal file
@ -0,0 +1,117 @@
|
||||
diff -ur nginx-1.0.8/src/http/ngx_http_request_body.c nginx-1.0.8-patched/src/http/ngx_http_request_body.c
|
||||
--- nginx-1.0.8/src/http/ngx_http_request_body.c 2011-09-30 22:36:19.000000000 +0800
|
||||
+++ nginx-1.0.8-patched/src/http/ngx_http_request_body.c 2011-10-21 21:54:08.460350482 +0800
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
r->main->count++;
|
||||
|
||||
- if (r->request_body || r->discard_body) {
|
||||
+ if (r->request_body || r->discard_body || r->content_length_n == 0) {
|
||||
post_handler(r);
|
||||
return NGX_OK;
|
||||
}
|
||||
@@ -440,7 +440,7 @@
|
||||
ssize_t size;
|
||||
ngx_event_t *rev;
|
||||
|
||||
- if (r != r->main || r->discard_body) {
|
||||
+ if (r != r->main || r->discard_body || r->content_length_n == 0) {
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
@@ -456,20 +456,22 @@
|
||||
ngx_del_timer(rev);
|
||||
}
|
||||
|
||||
- if (r->headers_in.content_length_n <= 0 || r->request_body) {
|
||||
+ r->content_length_n = r->headers_in.content_length_n;
|
||||
+
|
||||
+ if (r->content_length_n <= 0 || r->request_body) {
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
size = r->header_in->last - r->header_in->pos;
|
||||
|
||||
if (size) {
|
||||
- if (r->headers_in.content_length_n > size) {
|
||||
+ if (r->content_length_n > size) {
|
||||
r->header_in->pos += size;
|
||||
- r->headers_in.content_length_n -= size;
|
||||
+ r->content_length_n -= size;
|
||||
|
||||
} else {
|
||||
- r->header_in->pos += (size_t) r->headers_in.content_length_n;
|
||||
- r->headers_in.content_length_n = 0;
|
||||
+ r->header_in->pos += (size_t) r->content_length_n;
|
||||
+ r->content_length_n = 0;
|
||||
return NGX_OK;
|
||||
}
|
||||
}
|
||||
@@ -568,7 +570,7 @@
|
||||
"http read discarded body");
|
||||
|
||||
for ( ;; ) {
|
||||
- if (r->headers_in.content_length_n == 0) {
|
||||
+ if (r->content_length_n == 0) {
|
||||
r->read_event_handler = ngx_http_block_reading;
|
||||
return NGX_OK;
|
||||
}
|
||||
@@ -577,9 +579,9 @@
|
||||
return NGX_AGAIN;
|
||||
}
|
||||
|
||||
- size = (r->headers_in.content_length_n > NGX_HTTP_DISCARD_BUFFER_SIZE) ?
|
||||
+ size = (r->content_length_n > NGX_HTTP_DISCARD_BUFFER_SIZE) ?
|
||||
NGX_HTTP_DISCARD_BUFFER_SIZE:
|
||||
- (size_t) r->headers_in.content_length_n;
|
||||
+ (size_t) r->content_length_n;
|
||||
|
||||
n = r->connection->recv(r->connection, buffer, size);
|
||||
|
||||
@@ -596,7 +598,7 @@
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
- r->headers_in.content_length_n -= n;
|
||||
+ r->content_length_n -= n;
|
||||
}
|
||||
}
|
||||
|
||||
Only in nginx-1.0.8-patched/src/http: ngx_http_request_body.c~
|
||||
diff -ur nginx-1.0.8/src/http/ngx_http_request.c nginx-1.0.8-patched/src/http/ngx_http_request.c
|
||||
--- nginx-1.0.8/src/http/ngx_http_request.c 2011-09-30 22:36:19.000000000 +0800
|
||||
+++ nginx-1.0.8-patched/src/http/ngx_http_request.c 2011-10-21 19:06:38.404350692 +0800
|
||||
@@ -286,6 +286,8 @@
|
||||
|
||||
r->pipeline = hc->pipeline;
|
||||
|
||||
+ r->content_length_n = -1;
|
||||
+
|
||||
if (hc->nbusy) {
|
||||
r->header_in = hc->busy[0];
|
||||
}
|
||||
@@ -297,6 +299,8 @@
|
||||
return;
|
||||
}
|
||||
|
||||
+ r->content_length_n = -1;
|
||||
+
|
||||
hc->request = r;
|
||||
}
|
||||
|
||||
Only in nginx-1.0.8-patched/src/http: ngx_http_request.c~
|
||||
diff -ur nginx-1.0.8/src/http/ngx_http_request.h nginx-1.0.8-patched/src/http/ngx_http_request.h
|
||||
--- nginx-1.0.8/src/http/ngx_http_request.h 2011-08-29 18:39:23.000000000 +0800
|
||||
+++ nginx-1.0.8-patched/src/http/ngx_http_request.h 2011-10-21 17:26:13.203807584 +0800
|
||||
@@ -366,6 +366,9 @@
|
||||
ngx_pool_t *pool;
|
||||
ngx_buf_t *header_in;
|
||||
|
||||
+ off_t content_length_n;
|
||||
+ /* for discarding request body */
|
||||
+
|
||||
ngx_http_headers_in_t headers_in;
|
||||
ngx_http_headers_out_t headers_out;
|
||||
|
||||
Only in nginx-1.0.8-patched/src/http: ngx_http_request.h~
|
||||
Only in nginx-1.0.8-patched/src/http: tags
|
12
patches/nginx-1.0.8-named_location_clear_mods_ctx.patch
Normal file
12
patches/nginx-1.0.8-named_location_clear_mods_ctx.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- nginx-1.0.8/src/http/ngx_http_core_module.c 2011-09-27 19:14:02.000000000 +0800
|
||||
+++ nginx-1.0.8-patched/src/http/ngx_http_core_module.c 2011-10-13 15:02:24.414550532 +0800
|
||||
@@ -2542,6 +2542,9 @@
|
||||
r->content_handler = NULL;
|
||||
r->loc_conf = (*clcfp)->loc_conf;
|
||||
|
||||
+ /* clear the modules contexts */
|
||||
+ ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
|
||||
+
|
||||
ngx_http_update_location_config(r);
|
||||
|
||||
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
12
patches/nginx-1.1.5-named_location_clear_mods_ctx.patch
Normal file
12
patches/nginx-1.1.5-named_location_clear_mods_ctx.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- nginx-1.1.5/src/http/ngx_http_core_module.c 2011-09-27 19:14:02.000000000 +0800
|
||||
+++ nginx-1.1.5-patched/src/http/ngx_http_core_module.c 2011-10-13 15:02:24.414550532 +0800
|
||||
@@ -2542,6 +2542,9 @@
|
||||
r->content_handler = NULL;
|
||||
r->loc_conf = (*clcfp)->loc_conf;
|
||||
|
||||
+ /* clear the modules contexts */
|
||||
+ ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
|
||||
+
|
||||
ngx_http_update_location_config(r);
|
||||
|
||||
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
|
@ -48,6 +48,10 @@ patch -p1 -l < $root/patches/nginx-$main_ver-gzip_empty_flush_buf.patch || exit
|
||||
|
||||
patch -p1 < $root/patches/nginx-$main_ver-variable_header_ignore_no_hash.patch || exit 1
|
||||
|
||||
patch -p1 < $root/patches/nginx-$main_ver-named_location_clear_mods_ctx.patch || exit 1
|
||||
|
||||
patch -p1 < $root/patches/nginx-$main_ver-allow_request_body_updating.patch || exit 1
|
||||
|
||||
rm -f *.patch || exit 1
|
||||
|
||||
cd .. || exit 1
|
||||
@ -57,7 +61,7 @@ sed -i $"s/NGINX_VERSION \".unknown/NGINX_VERSION \".$minor_ver/" \
|
||||
./nginx-no_pool.patch || exit 1
|
||||
rm -rf no-pool-nginx-$ver
|
||||
|
||||
ver=0.37rc5
|
||||
ver=0.37rc6
|
||||
$root/util/get-tarball "http://github.com/agentzh/echo-nginx-module/tarball/v$ver" -O echo-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf echo-nginx-module-$ver.tar.gz || exit 1
|
||||
mv agentzh-echo-nginx-module-* echo-nginx-module-$ver || exit 1
|
||||
@ -101,7 +105,7 @@ mv chaoslawful-drizzle-nginx-module-* drizzle-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.3.1rc9
|
||||
ver=0.3.1rc20
|
||||
$root/util/get-tarball "http://github.com/chaoslawful/lua-nginx-module/tarball/v$ver" -O lua-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf lua-nginx-module-$ver.tar.gz || exit 1
|
||||
mv chaoslawful-lua-nginx-module-* ngx_lua-$ver || exit 1
|
||||
@ -122,7 +126,7 @@ mv agentzh-memc-nginx-module-* memc-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.13rc1
|
||||
ver=0.13rc2
|
||||
$root/util/get-tarball "http://github.com/agentzh/srcache-nginx-module/tarball/v$ver" -O srcache-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf srcache-nginx-module-$ver.tar.gz || exit 1
|
||||
mv agentzh-srcache-nginx-module-* srcache-nginx-module-$ver || exit 1
|
||||
@ -136,7 +140,7 @@ mv calio-form-input-nginx-module-* form-input-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.10rc4
|
||||
ver=0.10rc5
|
||||
$root/util/get-tarball "http://github.com/calio/iconv-nginx-module/tarball/v$ver" -O iconv-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf iconv-nginx-module-$ver.tar.gz || exit 1
|
||||
mv calio-iconv-nginx-module-* iconv-nginx-module-$ver || exit 1
|
||||
|
Reference in New Issue
Block a user