* STOP_SENDING.]
*
* TODO(QUIC FUTURE): Implement the latter case (currently we
- just always do STOP_SENDING).
+ * just always do STOP_SENDING).
*
* and;
*
unsigned int ready_for_gc : 1;
/* Set to 1 if this is currently counted in the shutdown flush stream count. */
unsigned int shutdown_flush : 1;
+ unsigned int have_final_size : 1;
};
#define QUIC_STREAM_INITIATOR_CLIENT 0
uint64_t *app_error_code)
{
int local_init;
- uint64_t final_size;
+ uint64_t scratch_pad; /* throw away value */
local_init = (ossl_quic_stream_is_server_init(qs) == qc->as_server);
if (app_error_code != NULL)
*app_error_code = UINT64_MAX;
else
- app_error_code = &final_size; /* throw away value */
+ app_error_code = &scratch_pad;
if (!ossl_quic_stream_is_bidi(qs) && local_init != is_write) {
/*
*app_error_code = !is_write
? qs->peer_reset_stream_aec
: qs->peer_stop_sending_aec;
- } else if (is_write && ossl_quic_sstream_get_final_size(qs->sstream, &final_size)) {
+ } else if (is_write && qs->have_final_size) {
/*
* Stream has been finished. Stream reset takes precedence over this for
* the write case as peer may not have received all data.
case QUIC_SSTREAM_STATE_DATA_SENT:
qs->send_state = QUIC_SSTREAM_STATE_DATA_RECVD;
+ /*
+ * Remember final size in case SSL_get_stream_write_state()
+ * gets called.
+ */
+ qs->have_final_size = ossl_quic_sstream_get_final_size(qs->sstream,
+ NULL);
+
/* We no longer need a QUIC_SSTREAM in this state. */
ossl_quic_sstream_free(qs->sstream);
qs->sstream = NULL;