struct quic_enc_level els[QUIC_TLS_ENC_LEVEL_MAX];
struct quic_pktns pktns[QUIC_TLS_PKTNS_MAX];
+ struct ssl_sock_ctx *xprt_ctx;
/* Used only to reach the tasklet for the I/O handler from this quic_conn object. */
struct connection *conn;
/* Output buffer used during the handshakes. */
}
else {
pkt->qc = qc;
- if (HA_ATOMIC_LOAD(&qc->conn))
- conn_ctx = HA_ATOMIC_LOAD(&qc->conn->xprt_ctx);
}
}
else {
goto err;
}
- if (HA_ATOMIC_LOAD(&qc->conn))
- conn_ctx = HA_ATOMIC_LOAD(&qc->conn->xprt_ctx);
-
pkt->qc = qc;
}
* will start it if these contexts for the connection are not already
* initialized.
*/
- if (conn_ctx && HA_ATOMIC_LOAD(&conn_ctx->conn->ctx))
+ conn_ctx = HA_ATOMIC_LOAD(&qc->xprt_ctx);
+ if (conn_ctx && conn_ctx->wait_event.tasklet)
tasklet_wakeup(conn_ctx->wait_event.tasklet);
TRACE_LEAVE(QUIC_EV_CONN_LPKT, qc ? qc : NULL, pkt);
static int qc_conn_init(struct connection *conn, void **xprt_ctx)
{
struct ssl_sock_ctx *ctx;
+ struct quic_conn *qc = NULL;
TRACE_ENTER(QUIC_EV_CONN_NEW, conn);
/* Server */
struct server *srv = __objt_server(conn->target);
unsigned char dcid[QUIC_HAP_CID_LEN];
- struct quic_conn *qc;
int ssl_err, ipv4;
ssl_err = SSL_ERROR_NONE;
else if (objt_listener(conn->target)) {
/* Listener */
struct bind_conf *bc = __objt_listener(conn->target)->bind_conf;
- struct quic_conn *qc = ctx->conn->qc;
+ qc = ctx->conn->qc;
ctx->qc = qc;
qc->tid = ctx->wait_event.tasklet->tid = quic_get_cid_tid(&qc->scid);
conn->flags |= CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN;
out:
+ HA_ATOMIC_STORE(&qc->xprt_ctx, ctx);
TRACE_LEAVE(QUIC_EV_CONN_NEW, conn);
return 0;