comparison src/http/ngx_http_request_body.c @ 5110:0bbdd966a383

Request body: next upstream fix. After introduction of chunked request body handling in 1.3.9 (r4931), r->request_body->bufs buffers have b->start pointing to original buffer start (and b->pos pointing to real data of this particular buffer). While this is ok as per se, it caused bad things (usually original request headers included before the request body) after reinit of the request chain in ngx_http_upstream_reinit() while sending the request to a next upstream server (which used to do b->pos = b->start for each buffer in the request chain). Patch by Piotr Sikora.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 14 Mar 2013 12:28:53 +0000
parents 43cb2c9799c1
children 57c3f84d72ce
comparison
equal deleted inserted replaced
5109:44bd04fbbb4f 5110:0bbdd966a383
824 824
825 ngx_memzero(b, sizeof(ngx_buf_t)); 825 ngx_memzero(b, sizeof(ngx_buf_t));
826 826
827 b->temporary = 1; 827 b->temporary = 1;
828 b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body; 828 b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
829 b->start = cl->buf->start; 829 b->start = cl->buf->pos;
830 b->pos = cl->buf->pos; 830 b->pos = cl->buf->pos;
831 b->last = cl->buf->last; 831 b->last = cl->buf->last;
832 b->end = cl->buf->end; 832 b->end = cl->buf->end;
833 833
834 size = cl->buf->last - cl->buf->pos; 834 size = cl->buf->last - cl->buf->pos;
931 931
932 ngx_memzero(b, sizeof(ngx_buf_t)); 932 ngx_memzero(b, sizeof(ngx_buf_t));
933 933
934 b->temporary = 1; 934 b->temporary = 1;
935 b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body; 935 b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
936 b->start = cl->buf->start; 936 b->start = cl->buf->pos;
937 b->pos = cl->buf->pos; 937 b->pos = cl->buf->pos;
938 b->last = cl->buf->last; 938 b->last = cl->buf->last;
939 b->end = cl->buf->end; 939 b->end = cl->buf->end;
940 940
941 *ll = tl; 941 *ll = tl;