comparison src/http/modules/ngx_http_addition_filter_module.c @ 6723:ebba2f980489

Addition filter: set last_in_chain flag when clearing last_buf. When the last_buf flag is cleared for add_after_body to append more data from a subrequest, other filters may still have buffered data, which should be flushed at this point. For example, the sub_filter may have a partial match buffered, which will only be flushed after the subrequest is done, ending up with interleaved data in output. Setting last_in_chain instead of last_buf flushes the data and fixes the order of output buffers.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 03 Oct 2016 21:03:27 +0300
parents e491b26fa5a1
children f583559aadc7
comparison
equal deleted inserted replaced
6722:6136a51f9c21 6723:ebba2f980489
169 last = 0; 169 last = 0;
170 170
171 for (cl = in; cl; cl = cl->next) { 171 for (cl = in; cl; cl = cl->next) {
172 if (cl->buf->last_buf) { 172 if (cl->buf->last_buf) {
173 cl->buf->last_buf = 0; 173 cl->buf->last_buf = 0;
174 cl->buf->last_in_chain = 1;
174 cl->buf->sync = 1; 175 cl->buf->sync = 1;
175 last = 1; 176 last = 1;
176 } 177 }
177 } 178 }
178 179