--- ngx_event_quic.c 2024-05-28 15:28:07.000000000 +0200 +++ ngx_event_quic.c 2025-02-04 23:33:38.990662931 +0100 @@ -308,8 +308,13 @@ qc->streams.client_max_streams_uni = qc->tp.initial_max_streams_uni; qc->streams.client_max_streams_bidi = qc->tp.initial_max_streams_bidi; - qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size, - ngx_max(2 * qc->tp.max_udp_payload_size, + // qc->tp.max_udp_payload_size is set via a constant in ngx_quic_init_transport_params() to 65527 which is wrong. + // It is not set by inspecting the peer's transport parameters, i think this happens at a later time in ngx_quic_apply_transport_params(), + // but there the initial congestion window is not recalculated and can't be since the peer's transport parameters are not available at that time. + // So for a fix for this experiment, the max_udp_payload_size is set to 1200 for only the calculation of the initial congestion window. + const int PATCHED_MAX_UDP_PAYLOAD_SIZE = 1200; + qc->congestion.window = ngx_min(10 * PATCHED_MAX_UDP_PAYLOAD_SIZE, + ngx_max(2 * PATCHED_MAX_UDP_PAYLOAD_SIZE, 14720)); qc->congestion.ssthresh = (size_t) -1; qc->congestion.recovery_start = ngx_current_msec;