quic: init crypto context on streams 07/32407/2
authorFlorin Coras <fcoras@cisco.com>
Thu, 20 May 2021 20:56:29 +0000 (13:56 -0700)
committerDamjan Marion <dmarion@me.com>
Fri, 21 May 2021 06:57:03 +0000 (06:57 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I901980f1f8ae8eb51c3972537ccac80f620868d0

src/plugins/quic/quic.c

index 6bdc17d..3223e47 100644 (file)
@@ -1014,6 +1014,7 @@ quic_on_stream_open (quicly_stream_open_t * self, quicly_stream_t * stream)
   sctx->stream = stream;
   sctx->c_flags |= TRANSPORT_CONNECTION_F_NO_LOOKUP;
   sctx->flags |= QUIC_F_IS_STREAM;
+  sctx->crypto_context_index = qctx->crypto_context_index;
   if (quicly_stream_is_unidirectional (stream->stream_id))
     stream_session->flags |= SESSION_F_UNIDIRECTIONAL;
 
@@ -1252,6 +1253,7 @@ quic_connect_stream (session_t * quic_session, session_endpoint_cfg_t * sep)
   quic_increment_counter (QUIC_ERROR_OPENED_STREAM, 1);
 
   sctx->stream = stream;
+  sctx->crypto_context_index = qctx->crypto_context_index;
 
   QUIC_DBG (2, "Opened stream %d, creating session", stream->stream_id);
 
@@ -1814,9 +1816,6 @@ quic_udp_session_connected_callback (u32 quic_app_index, u32 ctx_index,
       return 0;
     }
 
-  ctx->c_thread_index = thread_index;
-  ctx->c_c_index = ctx_index;
-
   QUIC_DBG (2, "New ctx [%u]%x", thread_index, (ctx) ? ctx_index : ~0);
 
   ctx->udp_session_handle = session_handle (udp_session);