upgraded patches for 1.1.5.

This commit is contained in:
agentzh (章亦春) 2011-11-08 22:18:30 +08:00
parent 8eb28a55d3
commit f54c295fd8
3 changed files with 56 additions and 6 deletions

View File

@ -1,5 +1,5 @@
--- nginx-1.0.9/src/http/ngx_http_variables.c 2011-05-30 20:36:17.000000000 +0800
+++ nginx-1.0.9-patched/src/http/ngx_http_variables.c 2011-11-08 21:39:28.509366052 +0800
+++ nginx-1.0.9-patched/src/http/ngx_http_variables.c 2011-11-08 22:17:55.774241258 +0800
@@ -648,7 +648,17 @@
a = (ngx_array_t *) ((char *) r + data);
@ -44,12 +44,10 @@
len += h[i]->value.len + sizeof("; ") - 1;
}
@@ -682,7 +695,12 @@
v->len = len;
@@ -683,9 +696,14 @@
v->data = p;
- for (i = 0; /* void */ ; i++) {
+ for (i = 0; i < n; i++) {
for (i = 0; /* void */ ; i++) {
+
+ if (h[i]->hash == 0) {
+ continue;
@ -57,7 +55,11 @@
+
p = ngx_copy(p, h[i]->value.data, h[i]->value.len);
if (i == n - 1) {
- if (i == n - 1) {
+ if (--n == 0) {
break;
}
@@ -738,6 +756,10 @@
i = 0;
}

View File

@ -0,0 +1,21 @@
--- nginx-1.1.5/src/event/modules/ngx_epoll_module.c 2011-09-30 22:12:53.000000000 +0800
+++ nginx-1.1.5-patched/src/event/modules/ngx_epoll_module.c 2011-11-07 18:07:04.764111952 +0800
@@ -681,6 +681,18 @@
wev = c->write;
+ if (c->fd == -1 || wev->instance != instance) {
+
+ /*
+ * the stale event from a file descriptor
+ * that was just closed in this iteration
+ */
+
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
+ "epoll: stale event %p", c);
+ continue;
+ }
+
if ((revents & EPOLLOUT) && wev->active) {
if (flags & NGX_POST_THREAD_EVENTS) {

View File

@ -0,0 +1,27 @@
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1309799136 -14400
# Node ID 99e276bba8596bc4df9e638482ee413f4c6bf700
# Parent e7b2f945d55ae44a2295facf9e3336dc4633e5b5
Core: fix body with request_body_in_single_buf.
If there were preread data and request body was big enough first part
of request body was duplicated.
See report here:
http://nginx.org/pipermail/nginx/2011-July/027756.html
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -372,7 +372,9 @@ ngx_http_do_read_client_request_body(ngx
}
}
- if (r->request_body_in_file_only && rb->bufs->next) {
+ if (rb->bufs->next
+ && (r->request_body_in_file_only || r->request_body_in_single_buf))
+ {
rb->bufs = rb->bufs->next;
}