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
/*
* 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.
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;
}
* 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,
/*
* 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)
*
* 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.
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);