summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-07-18 16:13:25 +0100
committerMatt Caswell <matt@openssl.org>2023-07-31 14:03:25 +0100
commitb864110a82096c6b824406a3f8686a5099ea17c4 (patch)
tree06ccb312f2ca5b6470ae324c45980995cffdcc5d /include
parent3415677eec8e0b474973115ad871430f11ced3fd (diff)
QUIC QSM: Infrastructure for tracking shutdown flush eligible streams
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21484)
Diffstat (limited to 'include')
-rw-r--r--include/internal/quic_stream_map.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/internal/quic_stream_map.h b/include/internal/quic_stream_map.h
index bff2e11fd2..74bfed7c8b 100644
--- a/include/internal/quic_stream_map.h
+++ b/include/internal/quic_stream_map.h
@@ -312,6 +312,8 @@ struct quic_stream_st {
unsigned int deleted : 1;
/* Set to 1 once the above conditions are actually met. */
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;
};
#define QUIC_STREAM_INITIATOR_CLIENT 0
@@ -517,7 +519,8 @@ typedef struct quic_stream_map_st {
QUIC_STREAM_LIST_NODE active_list;
QUIC_STREAM_LIST_NODE accept_list;
QUIC_STREAM_LIST_NODE ready_for_gc_list;
- size_t rr_stepping, rr_counter, num_accept;
+ size_t rr_stepping, rr_counter;
+ size_t num_accept, num_shutdown_flush;
QUIC_STREAM *rr_cur;
uint64_t (*get_stream_limit_cb)(int uni, void *arg);
void *get_stream_limit_cb_arg;
@@ -796,12 +799,32 @@ void ossl_quic_stream_map_remove_from_accept_queue(QUIC_STREAM_MAP *qsm,
size_t ossl_quic_stream_map_get_accept_queue_len(QUIC_STREAM_MAP *qsm);
/*
+ * Shutdown Flush and GC
+ * =====================
+ */
+
+/*
* Delete streams ready for GC. Pointers to those QUIC_STREAM objects become
* invalid.
*/
void ossl_quic_stream_map_gc(QUIC_STREAM_MAP *qsm);
/*
+ * Begins shutdown stream flush triage. Analyses all streams, including deleted
+ * but not yet GC'd streams, to determine if we should wait for that stream to
+ * be fully flushed before shutdown. After calling this, call
+ * ossl_quic_stream_map_is_shutdown_flush_finished() to determine if all
+ * shutdown flush eligible streams have been flushed.
+ */
+void ossl_quic_stream_map_begin_shutdown_flush(QUIC_STREAM_MAP *qsm);
+
+/*
+ * Returns 1 if all shutdown flush eligible streams have finished flushing,
+ * or if ossl_quic_stream_map_begin_shutdown_flush() has not been called.
+ */
+int ossl_quic_stream_map_is_shutdown_flush_finished(QUIC_STREAM_MAP *qsm);
+
+/*
* QUIC Stream Iterator
* ====================
*