summaryrefslogtreecommitdiffstats
path: root/ssl/quic/quic_tserver.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-04-28 16:56:33 +0100
committerHugo Landau <hlandau@openssl.org>2023-05-24 10:34:47 +0100
commit1df479a9f95d2862e32c43c89d17d3e094fb2292 (patch)
treec9e3f9383b4d1343a3604ec27da1a73a19d21dec /ssl/quic/quic_tserver.c
parentbc89c9f97735703f49f528d3c943de0b22ec33d7 (diff)
QUIC TSERVER: Allow detection of new incoming streams
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20856)
Diffstat (limited to 'ssl/quic/quic_tserver.c')
-rw-r--r--ssl/quic/quic_tserver.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c
index 8e15587bec..6788851f29 100644
--- a/ssl/quic/quic_tserver.c
+++ b/ssl/quic/quic_tserver.c
@@ -404,3 +404,16 @@ int ossl_quic_tserver_set_new_local_cid(QUIC_TSERVER *srv,
/* Replace existing local connection ID in the QUIC_CHANNEL */
return ossl_quic_channel_replace_local_cid(srv->ch, conn_id);
}
+
+uint64_t ossl_quic_tserver_pop_incoming_stream(QUIC_TSERVER *srv)
+{
+ QUIC_STREAM_MAP *qsm = ossl_quic_channel_get_qsm(srv->ch);
+ QUIC_STREAM *qs = ossl_quic_stream_map_peek_accept_queue(qsm);
+
+ if (qs == NULL)
+ return UINT64_MAX;
+
+ ossl_quic_stream_map_remove_from_accept_queue(qsm, qs, ossl_time_zero());
+
+ return qs->id;
+}