QUIC CONFORMANCE: RFC 9000 s. 13.3: MAX_STREAM_DATA generation

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21135)
This commit is contained in:
Hugo Landau 2023-06-06 16:25:11 +01:00 committed by Pauli
parent 96fa10f36f
commit 22f21fbdd6
2 changed files with 12 additions and 4 deletions

View File

@ -335,8 +335,9 @@ void ossl_quic_stream_map_update_state(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s)
&& !s->ready_for_gc
&& ((ossl_quic_stream_has_recv(s)
&& !ossl_quic_stream_recv_is_reset(s)
&& (s->want_max_stream_data
|| ossl_quic_rxfc_has_cwm_changed(&s->rxfc, 0)))
&& (s->recv_state == QUIC_RSTREAM_STATE_RECV
&& (s->want_max_stream_data
|| ossl_quic_rxfc_has_cwm_changed(&s->rxfc, 0))))
|| s->want_stop_sending
|| s->want_reset_stream
|| (!s->peer_stop_sending && stream_has_data_to_send(s)));

View File

@ -1923,8 +1923,15 @@ static int txp_generate_stream_related(OSSL_QUIC_TX_PACKETISER *txp,
= f.final_size - ossl_quic_txfc_get_swm(&stream->txfc);
}
/* Stream Flow Control Frames (MAX_STREAM_DATA) */
if (ossl_quic_stream_has_recv_buffer(stream)
/*
* Stream Flow Control Frames (MAX_STREAM_DATA)
*
* RFC 9000 s. 13.3: "An endpoint SHOULD stop sending MAX_STREAM_DATA
* frames when the receiving part of the stream enters a "Size Known" or
* "Reset Recvd" state." -- In practice, RECV is the only state
* in which it makes sense to generate more MAX_STREAM_DATA frames.
*/
if (stream->recv_state == QUIC_RSTREAM_STATE_RECV
&& (stream->want_max_stream_data
|| ossl_quic_rxfc_has_cwm_changed(&stream->rxfc, 0))) {