Skip to content

Commit

Permalink
Minor updates 2
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 96b7df6 commit 1d547f8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions include/internal/quic_stream_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions ssl/quic/quic_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 6 additions & 3 deletions ssl/quic/quic_rx_depack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ssl/quic/quic_txp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions test/quic_multistream_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1d547f8

Please sign in to comment.