[PATCH] Upstream: fixed unbuffered processing to flush postponed data
Maxim Dounin
mdounin at mdounin.ru
Thu Aug 20 22:35:51 UTC 2026
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1787265306 -10800
# Fri Aug 21 01:35:06 2026 +0300
# Node ID ea83a1624c33f405172b94403003f90e378cead8
# Parent 6df24c964d3f26bf982659e4a64afc4389da0752
Upstream: fixed unbuffered processing to flush postponed data.
Previously, ngx_http_upstream_process_non_buffered_request() only called
the output body filter chain if there are any output or busy buffers, or
if there are connection-level buffered data (that is, if we weren't able
to send all the data to the client). However, this might not be enough
when there are data postponed by the postpone filter due to other
subrequests: data postponed due to a subrequest were not sent after a
subrequest finalization and a parent request wakeup if there were no
busy buffers, which could be the case with gunzip.
The fix is to check r->postponed when calling ngx_http_output_filter().
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -3834,7 +3834,9 @@ ngx_http_upstream_process_non_buffered_r
if (do_write) {
- if (u->out_bufs || u->busy_bufs || downstream->buffered) {
+ if (u->out_bufs || u->busy_bufs || downstream->buffered
+ || r->postponed)
+ {
rc = ngx_http_output_filter(r, u->out_bufs);
if (rc == NGX_ERROR) {
More information about the nginx-devel
mailing list