Welcome! Log In Create A New Profile

Advanced

[PATCH 01 of 14] Output chain: propagate last_buf flag to c->send_chain()

Piotr Sikora via nginx-devel
June 22, 2017 04:36PM
# HG changeset patch
# User Piotr Sikora <piotrsikora@google.com>
# Date 1491708381 25200
# Sat Apr 08 20:26:21 2017 -0700
# Node ID 5f5d70428655db0889a2111d17d912a7383df152
# Parent a39bc74873faf9e5bea616561b43f6ecc55229f9
Output chain: propagate last_buf flag to c->send_chain().

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

diff -r a39bc74873fa -r 5f5d70428655 src/core/ngx_output_chain.c
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -658,6 +658,7 @@ ngx_chain_writer(void *data, ngx_chain_t
ngx_chain_writer_ctx_t *ctx = data;

off_t size;
+ ngx_uint_t last;
ngx_chain_t *cl, *ln, *chain;
ngx_connection_t *c;

@@ -689,9 +690,10 @@ ngx_chain_writer(void *data, ngx_chain_t

size += ngx_buf_size(in->buf);

- ngx_log_debug2(NGX_LOG_DEBUG_CORE, c->log, 0,
- "chain writer buf fl:%d s:%uO",
- in->buf->flush, ngx_buf_size(in->buf));
+ ngx_log_debug3(NGX_LOG_DEBUG_CORE, c->log, 0,
+ "chain writer buf fl:%d l:%d s:%uO",
+ in->buf->flush, in->buf->last_buf,
+ ngx_buf_size(in->buf));

cl = ngx_alloc_chain_link(ctx->pool);
if (cl == NULL) {
@@ -707,6 +709,8 @@ ngx_chain_writer(void *data, ngx_chain_t
ngx_log_debug1(NGX_LOG_DEBUG_CORE, c->log, 0,
"chain writer in: %p", ctx->out);

+ last = 0;
+
for (cl = ctx->out; cl; cl = cl->next) {

#if 1
@@ -732,9 +736,16 @@ ngx_chain_writer(void *data, ngx_chain_t
#endif

size += ngx_buf_size(cl->buf);
+
+ if (cl->buf->last_buf) {
+ last = 1;
+ }
}

- if (size == 0 && !c->buffered) {
+ if (size == 0
+ && !c->buffered
+ && !(last && c->need_last_buf))
+ {
return NGX_OK;
}

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

[PATCH 01 of 14] Output chain: propagate last_buf flag to c->send_chain()

Piotr Sikora via nginx-devel 918 June 22, 2017 04:36PM

[PATCH 02 of 14] Upstream keepalive: preserve c->data

Piotr Sikora via nginx-devel 337 June 22, 2017 04:36PM

[PATCH 03 of 14] HTTP/2: add debug logging of control frames

Piotr Sikora via nginx-devel 408 June 22, 2017 04:36PM

Re: [PATCH 03 of 14] HTTP/2: add debug logging of control frames

Valentin V. Bartenev 452 July 03, 2017 10:00AM

Re: [PATCH 03 of 14] HTTP/2: add debug logging of control frames

Piotr Sikora via nginx-devel 420 July 05, 2017 06:04AM

Re: [PATCH 03 of 14] HTTP/2: add debug logging of control frames

Valentin V. Bartenev 528 July 10, 2017 11:28AM

[PATCH 04 of 14] HTTP/2: s/client/peer/

Piotr Sikora via nginx-devel 470 June 22, 2017 04:36PM

[PATCH 05 of 14] HTTP/2: introduce h2c->conf_ctx

Piotr Sikora via nginx-devel 425 June 22, 2017 04:36PM

[PATCH 06 of 14] HTTP/2: introduce stream->fake_connection

Piotr Sikora via nginx-devel 478 June 22, 2017 04:36PM

[PATCH 07 of 14] HTTP/2: introduce ngx_http_v2_handle_event()

Piotr Sikora via nginx-devel 424 June 22, 2017 04:36PM

[PATCH 08 of 14] HTTP/2: add HTTP/2 to upstreams

Piotr Sikora via nginx-devel 686 June 22, 2017 04:36PM

[PATCH 09 of 14] Proxy: add "proxy_ssl_alpn" directive

Piotr Sikora via nginx-devel 617 June 22, 2017 04:36PM

Re: [PATCH 09 of 14] Proxy: add "proxy_ssl_alpn" directive

Maxim Dounin 385 July 13, 2017 12:30PM

[PATCH 10 of 14] Proxy: always emit "Host" header first

Piotr Sikora via nginx-devel 349 June 22, 2017 04:36PM

Re: [PATCH 10 of 14] Proxy: always emit "Host" header first

Maxim Dounin 447 July 04, 2017 12:50PM

Re: [PATCH 10 of 14] Proxy: always emit "Host" header first

Piotr Sikora via nginx-devel 339 July 05, 2017 06:30AM

[PATCH 11 of 14] Proxy: split configured header names and values

Piotr Sikora via nginx-devel 420 June 22, 2017 04:36PM

Re: [PATCH 11 of 14] Proxy: split configured header names and values

Maxim Dounin 422 July 03, 2017 10:20AM

[PATCH 13 of 14] Proxy: add "proxy_pass_trailers" directive

Piotr Sikora via nginx-devel 494 June 22, 2017 04:36PM

[PATCH 12 of 14] Proxy: add HTTP/2 support

Piotr Sikora via nginx-devel 1306 June 22, 2017 04:36PM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Maxim Dounin 503 July 19, 2017 10:36AM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Piotr Sikora via nginx-devel 482 July 25, 2017 09:30PM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Piotr Sikora via nginx-devel 516 July 31, 2017 06:06PM

Re: [PATCH 12 of 14] Proxy: add HTTP/2 support

Maxim Dounin 600 August 08, 2017 02:06PM

[PATCH 14 of 14] Cache: add HTTP/2 support

Piotr Sikora via nginx-devel 481 June 22, 2017 04:36PM



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

Online Users

Guests: 300
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