unsigned tcp_nopush:2; /* ngx_connection_tcp_nopush_e */
unsigned need_last_buf:1;
+ unsigned need_flush_buf:1;
#if (NGX_HAVE_SENDFILE_NODISKIO || NGX_COMPAT)
unsigned busy_count:2;
c->recv = ngx_udp_recv;
c->send = ngx_send;
c->send_chain = ngx_udp_send_chain;
+
+ c->need_flush_buf = 1;
}
c->log_error = pc->log_error;
c->send = ngx_udp_send;
c->send_chain = ngx_udp_send_chain;
+ c->need_flush_buf = 1;
+
c->log = log;
c->pool->log = log;
c->listening = ls;
if (size == 0
&& !(c->buffered & NGX_LOWLEVEL_BUFFERED)
- && !(last && c->need_last_buf))
+ && !(last && c->need_last_buf)
+ && !(flush && c->need_flush_buf))
{
if (last || flush || sync) {
for (cl = r->out; cl; /* void */) {
fc->send_chain = ngx_http_v2_send_chain;
fc->need_last_buf = 1;
+ fc->need_flush_buf = 1;
return ngx_http_v2_filter_send(fc, stream);
}
static ngx_inline ngx_int_t
ngx_http_v2_filter_send(ngx_connection_t *fc, ngx_http_v2_stream_t *stream)
{
- if (stream->queued == 0) {
+ ngx_connection_t *c;
+
+ c = stream->connection->connection;
+
+ if (stream->queued == 0 && !c->buffered) {
fc->buffered &= ~NGX_HTTP_V2_BUFFERED;
return NGX_OK;
}
if (size == 0
&& !(c->buffered & NGX_LOWLEVEL_BUFFERED)
&& !(last && c->need_last_buf)
- && !(c->type == SOCK_DGRAM && flush))
+ && !(flush && c->need_flush_buf))
{
if (last || flush || sync) {
for (cl = *out; cl; /* void */) {