static quic_main_t quic_main;
static void quic_update_timer (quic_ctx_t * ctx);
+static int quic_on_client_connected (quic_ctx_t * ctx);
static u32
quic_ctx_alloc (u32 thread_index)
qctx = quic_get_conn_ctx (stream->conn);
+ /* Might need to signal that the connection is ready if the first thing the
+ * server does is open a stream */
+ if (qctx->conn_state == QUIC_CONN_STATE_HANDSHAKE)
+ {
+ if (quicly_connection_is_ready (qctx->conn))
+ {
+ qctx->conn_state = QUIC_CONN_STATE_READY;
+ if (quicly_is_client (qctx->conn))
+ {
+ quic_on_client_connected (qctx);
+ /* ctx might be invalidated */
+ qctx = quic_get_conn_ctx (stream->conn);
+ }
+ }
+ }
+
stream_session = session_alloc (qctx->c_thread_index);
QUIC_DBG (2, "ACCEPTED stream_session 0x%lx ctx %u",
session_handle (stream_session), sctx_id);
/* Notify accept on parent qsession, but only if this is not a locally
* initiated stream */
if (!quicly_stream_is_self_initiated (stream))
- {
- quic_accept_stream (stream);
- }
+ quic_accept_stream (stream);
return 0;
}
ctx->client_opaque = sep->opaque;
ctx->c_flags |= TRANSPORT_CONNECTION_F_NO_LOOKUP;
if (sep->hostname)
- {
- ctx->srv_hostname = format (0, "%v", sep->hostname);
- vec_terminate_c_string (ctx->srv_hostname);
- }
+ ctx->srv_hostname = format (0, "%v", sep->hostname);
else
- {
- /* needed by quic for crypto + determining client / server */
- ctx->srv_hostname =
- format (0, "%U", format_ip46_address, &sep->ip, sep->is_ip4);
- }
+ /* needed by quic for crypto + determining client / server */
+ ctx->srv_hostname =
+ format (0, "%U", format_ip46_address, &sep->ip, sep->is_ip4);
+ vec_terminate_c_string (ctx->srv_hostname);
clib_memcpy (&cargs->sep, sep, sizeof (session_endpoint_cfg_t));
cargs->sep.transport_proto = TRANSPORT_PROTO_UDPC;
if (packets_ctx[i].thread_index != thread_index)
continue;
+ check_quic_client_connected (&packets_ctx[i]);
ctx =
quic_ctx_get (packets_ctx[i].ctx_index,
packets_ctx[i].thread_index);
- check_quic_client_connected (&packets_ctx[i]);
quic_send_packets (ctx);
}
svm_fifo_dequeue_drop (f, fifo_offset);
{
.version = VPP_BUILD_VER,
.description = "Quic transport protocol",
+ .default_disabled = 1,
};
/* *INDENT-ON* */