Skip to content

Commit

Permalink
QUIC CONFORMANCE: RFC 9000 s. 13.3: MAX_STREAM_DATA generation
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #21135)
  • Loading branch information
hlandau authored and paulidale committed Jul 16, 2023
1 parent 96fa10f commit 22f21fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ssl/quic/quic_stream_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
11 changes: 9 additions & 2 deletions ssl/quic/quic_txp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {

Expand Down

0 comments on commit 22f21fb

Please sign in to comment.