diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-08-18 17:08:18 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-08-23 17:18:48 +0200 |
commit | 64fd69911e04cec45f65b396a4e91d6caa4fdc9a (patch) | |
tree | 1168c70807302e3dcc65d29a0a9b47c4dded6be0 /include | |
parent | 96014840b69b3ec2f82e230a27cc5c1fa3bfb1bc (diff) |
ossl_quic_tx_packetiser_generate(): Always report if packets were sent
Even in case of later failure we need to flush
the previous packets.
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21700)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/quic_txp.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/include/internal/quic_txp.h b/include/internal/quic_txp.h index 5ea464ddd8..09d552ef04 100644 --- a/include/internal/quic_txp.h +++ b/include/internal/quic_txp.h @@ -81,20 +81,17 @@ void ossl_quic_tx_packetiser_record_received_closing_bytes( * generate any frames, and generating a datagram which coalesces packets for * any ELs which do. * - * Returns TX_PACKETISER_RES_FAILURE on failure (e.g. allocation error), - * TX_PACKETISER_RES_NO_PKT if no packets were sent (e.g. because nothing wants - * to send anything), and TX_PACKETISER_RES_SENT_PKT if packets were sent. + * Returns 0 on failure (e.g. allocation error or other errors), 1 otherwise. * - * *status is filled with status information about the generated packet, if any. + * *status is filled with status information about the generated packet. + * It is always filled even in case of failure. In particular, packets can be + * sent even if failure is later returned. * See QUIC_TXP_STATUS for details. */ -#define TX_PACKETISER_RES_FAILURE 0 -#define TX_PACKETISER_RES_NO_PKT 1 -#define TX_PACKETISER_RES_SENT_PKT 2 - typedef struct quic_txp_status_st { int sent_ack_eliciting; /* Was an ACK-eliciting packet sent? */ int sent_handshake; /* Was a Handshake packet sent? */ + size_t sent_pkt; /* Number of packets sent (0 if nothing was sent) */ } QUIC_TXP_STATUS; int ossl_quic_tx_packetiser_generate(OSSL_QUIC_TX_PACKETISER *txp, |