added Maxim Dounin's patches.

This commit is contained in:
agentzh (章亦春) 2011-07-07 12:14:54 +08:00
parent 5714d20c1e
commit 60109db59a
3 changed files with 81 additions and 0 deletions

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;
}

View File

@ -0,0 +1,17 @@
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1309776931 -14400
# Node ID e7b2f945d55ae44a2295facf9e3336dc4633e5b5
# Parent 610e909bb9e29766188aa86fae3abe0bd3432940
Core: fix body if it's preread and there are extra data.
--- nginx-0.8.54/src/http/ngx_http_request_body.c 2011-07-05 12:11:21.619264633 +0800
+++ nginx-0.8.54-patched/src/http/ngx_http_request_body.c 2011-07-05 12:14:30.694321554 +0800
@@ -141,6 +141,7 @@
/* the whole request body was pre-read */
+ b->last = b->pos + r->headers_in.content_length_n;
r->header_in->pos += (size_t) r->headers_in.content_length_n;
r->request_length += r->headers_in.content_length_n;

View File

@ -0,0 +1,37 @@
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1309424678 -14400
# Node ID 60a67d95638f9187418a3a26c1fcb9f06be7a4fc
# Parent 1c167244d2fdb064c159012c50a7ae3fd1ed254a
Fix another gcc46 unused-but-set warning.
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -1687,20 +1687,24 @@ ngx_ssl_get_cached_session(ngx_ssl_conn_
ngx_int_t rc;
ngx_shm_zone_t *shm_zone;
ngx_slab_pool_t *shpool;
+#if (NGX_DEBUG)
ngx_connection_t *c;
+#endif
ngx_rbtree_node_t *node, *sentinel;
ngx_ssl_session_t *sess;
ngx_ssl_sess_id_t *sess_id;
ngx_ssl_session_cache_t *cache;
u_char buf[NGX_SSL_MAX_SESSION_SIZE];
- c = ngx_ssl_get_connection(ssl_conn);
-
hash = ngx_crc32_short(id, (size_t) len);
*copy = 0;
+#if (NGX_DEBUG)
+ c = ngx_ssl_get_connection(ssl_conn);
+
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"ssl get session: %08XD:%d", hash, len);
+#endif
shm_zone = SSL_CTX_get_ex_data(SSL_get_SSL_CTX(ssl_conn),
ngx_ssl_session_cache_index);