comparison src/stream/ngx_stream_write_filter_module.c @ 8006:32b0ba4855a6

HTTP/2: made it possible to flush response headers (ticket #1743). Response headers can be buffered in the SSL buffer. But stream's fake connection buffered flag did not reflect this, so any attempts to flush the buffer without sending additional data were stopped by the write filter. It does not seem to be possible to reflect this in fc->buffered though, as we never known if main connection's c->buffered corresponds to the particular stream or not. As such, fc->buffered might prevent request finalization due to sending data on some other stream. Fix is to implement handling of flush buffers when the c->need_flush_buf flag is set, similarly to the existing last buffer handling. The same flag is now used for UDP sockets in the stream module instead of explicit checking of c->type.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 03 Feb 2022 01:44:38 +0300
parents d127837c714f
children 9ea62b6250f2
comparison
equal deleted inserted replaced
8005:dd718d1cef3c 8006:32b0ba4855a6
233 "stream write filter: l:%ui f:%ui s:%O", last, flush, size); 233 "stream write filter: l:%ui f:%ui s:%O", last, flush, size);
234 234
235 if (size == 0 235 if (size == 0
236 && !(c->buffered & NGX_LOWLEVEL_BUFFERED) 236 && !(c->buffered & NGX_LOWLEVEL_BUFFERED)
237 && !(last && c->need_last_buf) 237 && !(last && c->need_last_buf)
238 && !(c->type == SOCK_DGRAM && flush)) 238 && !(flush && c->need_flush_buf))
239 { 239 {
240 if (last || flush || sync) { 240 if (last || flush || sync) {
241 for (cl = *out; cl; /* void */) { 241 for (cl = *out; cl; /* void */) {
242 ln = cl; 242 ln = cl;
243 cl = cl->next; 243 cl = cl->next;