diff options
-rw-r--r-- | include/internal/quic_stream_map.h | 4 | ||||
-rw-r--r-- | ssl/quic/quic_impl.c | 7 | ||||
-rw-r--r-- | ssl/quic/quic_rx_depack.c | 9 | ||||
-rw-r--r-- | ssl/quic/quic_txp.c | 2 | ||||
-rw-r--r-- | test/quic_multistream_test.c | 6 |
5 files changed, 16 insertions, 12 deletions
diff --git a/include/internal/quic_stream_map.h b/include/internal/quic_stream_map.h index 3202382d0a..bff2e11fd2 100644 --- a/include/internal/quic_stream_map.h +++ b/include/internal/quic_stream_map.h @@ -164,7 +164,7 @@ struct quic_stream_st { unsigned int active : 1; /* - * This is a cpoy of the QUIC connection as_server value, indicating + * This is a copy of the QUIC connection as_server value, indicating * whether we are locally operating as a server or not. Having this * significantly simplifies stream type determination relative to our * perspective. It never changes after a QUIC_STREAM is created and is the @@ -717,7 +717,7 @@ int ossl_quic_stream_map_notify_totally_received(QUIC_STREAM_MAP *qsm, /* * Transitions from the DATA_RECVD receive stream state to the DATA_READ state. - * This shuld be called once all data for a receive stream is read by the + * This should be called once all data for a receive stream is read by the * application. * * Returns 1 if the transition was taken. diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 3051a1318c..d9bdf74efe 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -2753,11 +2753,14 @@ int ossl_quic_stream_reset(SSL *ssl, qs = ctx.xso->stream; error_code = (args != NULL ? args->quic_error_code : 0); - if (!quic_validate_for_write(ctx.xso, &err)) - return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, err, NULL); + if (!quic_validate_for_write(ctx.xso, &err)) { + ok = QUIC_RAISE_NON_NORMAL_ERROR(&ctx, err, NULL); + goto err; + } ok = ossl_quic_stream_map_reset_stream_send_part(qsm, qs, error_code); +err: quic_unlock(ctx.qc); return ok; } diff --git a/ssl/quic/quic_rx_depack.c b/ssl/quic/quic_rx_depack.c index 71f47705f3..a3db49b7ff 100644 --- a/ssl/quic/quic_rx_depack.c +++ b/ssl/quic/quic_rx_depack.c @@ -195,7 +195,7 @@ static int depack_do_frame_reset_stream(PACKET *pkt, * Depending on the receive part state this is handled either as a reset * transition or a no-op (e.g. if a reset has already been received before, * or the application already retired a FIN). Best effort - there are no - * protoocol error conditions we need to check for here. + * protocol error conditions we need to check for here. */ ossl_quic_stream_map_notify_reset_recv_part(&ch->qsm, stream, frame_data.app_error_code, @@ -571,9 +571,12 @@ static int depack_do_frame_stream(PACKET *pkt, QUIC_CHANNEL *ch, /* * rs_fin will be 1 only if we can read all data up to and including the FIN - * without any gaps before it; this implies we have received all data. + * without any gaps before it; this implies we have received all data. Avoid + * calling ossl_quic_rstream_available() where it is not necessary as it is + * more expensive. */ - if (!ossl_quic_rstream_available(stream->rstream, &rs_avail, &rs_fin)) + if (stream->recv_state != QUIC_RSTREAM_STATE_SIZE_KNOWN + || !ossl_quic_rstream_available(stream->rstream, &rs_avail, &rs_fin)) return 0; if (rs_fin) diff --git a/ssl/quic/quic_txp.c b/ssl/quic/quic_txp.c index a4957c7c39..e008255b22 100644 --- a/ssl/quic/quic_txp.c +++ b/ssl/quic/quic_txp.c @@ -1964,7 +1964,7 @@ static int txp_generate_stream_related(OSSL_QUIC_TX_PACKETISER *txp, * * RFC 9000 s. 3.3: A sender MUST NOT send a STREAM [...] frame for a * stream in the "Reset Sent" state [or any terminal state]. We don't - * send any moore STREAM frames if we are sending, have sent, or are + * send any more STREAM frames if we are sending, have sent, or are * planning to send, RESET_STREAM. The other terminal state is Data * Recvd, but txp_generate_stream_frames() is guaranteed to generate * nothing in this case. diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c index ad6c0c9e64..a8e345202a 100644 --- a/test/quic_multistream_test.c +++ b/test/quic_multistream_test.c @@ -458,10 +458,8 @@ static void helper_cleanup(struct helper *h) BIO_free(h->s_qtf_wbio_own); h->s_qtf_wbio_own = NULL; - if (h->qtf != NULL) { - qtest_fault_free(h->qtf); - h->qtf = NULL; - } + qtest_fault_free(h->qtf); + h->qtf = NULL; if (h->s_fd >= 0) { BIO_closesocket(h->s_fd); |