Welcome! Log In Create A New Profile

Advanced

[nginx] Addition filter: set last_in_chain flag when clearing last_buf.

Roman Arutyunyan
October 04, 2016 06:50AM
details: http://hg.nginx.org/nginx/rev/ebba2f980489
branches:
changeset: 6723:ebba2f980489
user: Roman Arutyunyan <arut@nginx.com>
date: Mon Oct 03 21:03:27 2016 +0300
description:
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.

diffstat:

src/http/modules/ngx_http_addition_filter_module.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r 6136a51f9c21 -r ebba2f980489 src/http/modules/ngx_http_addition_filter_module.c
--- a/src/http/modules/ngx_http_addition_filter_module.c Mon Oct 03 20:48:51 2016 +0300
+++ b/src/http/modules/ngx_http_addition_filter_module.c Mon Oct 03 21:03:27 2016 +0300
@@ -171,6 +171,7 @@ ngx_http_addition_body_filter(ngx_http_r
for (cl = in; cl; cl = cl->next) {
if (cl->buf->last_buf) {
cl->buf->last_buf = 0;
+ cl->buf->last_in_chain = 1;
cl->buf->sync = 1;
last = 1;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Addition filter: set last_in_chain flag when clearing last_buf.

Roman Arutyunyan 475 October 04, 2016 06:50AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 111
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready