diff src/event/quic/ngx_event_quic_streams.c @ 8713:d6ef13c5fd8e quic

QUIC: simplified configuration. Directives that set transport parameters are removed from the configuration. Corresponding values are derived from the quic configuration or initialized to default. Whenever possible, quic configuration parameters are taken from higher-level protocol settings, i.e. HTTP/3.
author Vladimir Homutov <vl@nginx.com>
date Mon, 06 Dec 2021 15:19:54 +0300
parents d041b8d6ab0b
children 86f5a738ac2a
line wrap: on
line diff
--- a/src/event/quic/ngx_event_quic_streams.c
+++ b/src/event/quic/ngx_event_quic_streams.c
@@ -851,7 +851,7 @@ ngx_quic_max_stream_flow(ngx_connection_
     qs = c->quic;
     qc = ngx_quic_get_connection(qs->parent);
 
-    size = NGX_QUIC_STREAM_BUFSIZE;
+    size = qc->conf->stream_buffer_size;
     sent = c->sent;
     unacked = sent - qs->acked;
 
@@ -859,15 +859,13 @@ ngx_quic_max_stream_flow(ngx_connection_
         qc->streams.send_max_data = qc->ctp.initial_max_data;
     }
 
-    if (unacked >= NGX_QUIC_STREAM_BUFSIZE) {
+    if (unacked >= size) {
         ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
                        "quic send flow hit buffer size");
         return 0;
     }
 
-    if (unacked + size > NGX_QUIC_STREAM_BUFSIZE) {
-        size = NGX_QUIC_STREAM_BUFSIZE - unacked;
-    }
+    size -= unacked;
 
     if (qc->streams.sent >= qc->streams.send_max_data) {
         ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
@@ -1493,7 +1491,7 @@ ngx_quic_handle_stream_ack(ngx_connectio
     sent = qs->connection->sent;
     unacked = sent - qs->acked;
 
-    if (unacked >= NGX_QUIC_STREAM_BUFSIZE && wev->active) {
+    if (unacked >= qc->conf->stream_buffer_size && wev->active) {
         wev->ready = 1;
         ngx_post_event(wev, &ngx_posted_events);
     }