comparison src/event/quic/ngx_event_quic_streams.c @ 8924: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
comparison
equal deleted inserted replaced
8923:651cc905b7c2 8924:d6ef13c5fd8e
849 ngx_quic_connection_t *qc; 849 ngx_quic_connection_t *qc;
850 850
851 qs = c->quic; 851 qs = c->quic;
852 qc = ngx_quic_get_connection(qs->parent); 852 qc = ngx_quic_get_connection(qs->parent);
853 853
854 size = NGX_QUIC_STREAM_BUFSIZE; 854 size = qc->conf->stream_buffer_size;
855 sent = c->sent; 855 sent = c->sent;
856 unacked = sent - qs->acked; 856 unacked = sent - qs->acked;
857 857
858 if (qc->streams.send_max_data == 0) { 858 if (qc->streams.send_max_data == 0) {
859 qc->streams.send_max_data = qc->ctp.initial_max_data; 859 qc->streams.send_max_data = qc->ctp.initial_max_data;
860 } 860 }
861 861
862 if (unacked >= NGX_QUIC_STREAM_BUFSIZE) { 862 if (unacked >= size) {
863 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, 863 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
864 "quic send flow hit buffer size"); 864 "quic send flow hit buffer size");
865 return 0; 865 return 0;
866 } 866 }
867 867
868 if (unacked + size > NGX_QUIC_STREAM_BUFSIZE) { 868 size -= unacked;
869 size = NGX_QUIC_STREAM_BUFSIZE - unacked;
870 }
871 869
872 if (qc->streams.sent >= qc->streams.send_max_data) { 870 if (qc->streams.sent >= qc->streams.send_max_data) {
873 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, 871 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
874 "quic send flow hit MAX_DATA"); 872 "quic send flow hit MAX_DATA");
875 return 0; 873 return 0;
1491 1489
1492 wev = qs->connection->write; 1490 wev = qs->connection->write;
1493 sent = qs->connection->sent; 1491 sent = qs->connection->sent;
1494 unacked = sent - qs->acked; 1492 unacked = sent - qs->acked;
1495 1493
1496 if (unacked >= NGX_QUIC_STREAM_BUFSIZE && wev->active) { 1494 if (unacked >= qc->conf->stream_buffer_size && wev->active) {
1497 wev->ready = 1; 1495 wev->ready = 1;
1498 ngx_post_event(wev, &ngx_posted_events); 1496 ngx_post_event(wev, &ngx_posted_events);
1499 } 1497 }
1500 1498
1501 qs->acked += f->u.stream.length; 1499 qs->acked += f->u.stream.length;