summaryrefslogtreecommitdiffstats
path: root/src/plugins/quic
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-07-08 18:18:27 +0200
committerDave Wallace <dwallacelf@gmail.com>2019-07-09 17:07:22 +0000
commitace51525552375b4716c01a6f9ba5261fd64f940 (patch)
tree6c4b7b1e240a819f8989ecd47c0e71ec43463d3a /src/plugins/quic
parent50f4a417147ae4aae6ad8cddb0c7709420c712f0 (diff)
quic: echo thread can handle multiple sessions
Type: feature Change-Id: Ibb60d5b46aafe109a81a8604712a917f6e246eaf Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/quic')
-rw-r--r--src/plugins/quic/quic.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index 8732b7dac72..f38a7ca30a6 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -307,6 +307,14 @@ quic_ctx_get (u32 ctx_index, u32 thread_index)
}
static quic_ctx_t *
+quic_ctx_get_if_valid (u32 ctx_index, u32 thread_index)
+{
+ if (pool_is_free_index (quic_main.ctx_pool[thread_index], ctx_index))
+ return 0;
+ return pool_elt_at_index (quic_main.ctx_pool[thread_index], ctx_index);
+}
+
+static quic_ctx_t *
quic_get_conn_ctx (quicly_conn_t * conn)
{
u64 conn_data;
@@ -1494,7 +1502,9 @@ quic_connect (transport_endpoint_cfg_t * tep)
static void
quic_proto_on_close (u32 ctx_index, u32 thread_index)
{
- quic_ctx_t *ctx = quic_ctx_get (ctx_index, thread_index);
+ quic_ctx_t *ctx = quic_ctx_get_if_valid (ctx_index, thread_index);
+ if (!ctx)
+ return;
#if QUIC_DEBUG >= 2
session_t *stream_session =
session_get (ctx->c_s_index, ctx->c_thread_index);