SSL_free((*ctx)->ssl);
pool_free(pool_head_quic_ssl_sock_ctx, *ctx);
*ctx = NULL;
-
- _HA_ATOMIC_DEC(&global.sslconns);
}
#endif /* _HAPROXY_QUIC_SSL_H */
struct quic_conn *qc = NULL;
struct listener *l = NULL;
struct quic_cc_algo *cc_algo = NULL;
- unsigned int next_actconn = 0;
+ unsigned int next_actconn = 0, next_sslconn = 0;
TRACE_ENTER(QUIC_EV_CONN_INIT);
goto err;
}
+ next_sslconn = increment_sslconn();
+ if (!next_sslconn) {
+ TRACE_STATE("sslconn reached", QUIC_EV_CONN_INIT);
+ goto err;
+ }
+
qc = pool_alloc(pool_head_quic_conn);
if (!qc) {
TRACE_ERROR("Could not allocate a new connection", QUIC_EV_CONN_INIT);
/* Now that quic_conn instance is allocated, quic_conn_release() will
* ensure global accounting is decremented.
*/
- next_actconn = 0;
+ next_sslconn = next_actconn = 0;
/* Initialize in priority qc members required for a safe dealloc. */
qc->nictx = NULL;
*/
if (next_actconn)
_HA_ATOMIC_DEC(&actconn);
+ if (next_sslconn)
+ _HA_ATOMIC_DEC(&global.sslconns);
TRACE_LEAVE(QUIC_EV_CONN_INIT);
return NULL;
* time with limited ressources.
*/
_HA_ATOMIC_DEC(&actconn);
+ _HA_ATOMIC_DEC(&global.sslconns);
TRACE_PROTO("QUIC conn. freed", QUIC_EV_CONN_FREED, qc);
leave:
struct quic_conn *qc = NULL;
struct proxy *prx;
struct quic_counters *prx_counters;
- unsigned int next_sslconn = 0;
TRACE_ENTER(QUIC_EV_CONN_LPKT);
pkt->saddr = dgram->saddr;
ipv4 = dgram->saddr.ss_family == AF_INET;
- next_sslconn = increment_sslconn();
- if (!next_sslconn) {
- TRACE_STATE("drop packet on sslconn reached",
- QUIC_EV_CONN_LPKT, NULL, NULL, NULL, pkt->version);
- goto err;
- }
-
/* Generate the first connection CID. This is derived from the client
* ODCID and address. This allows to retrieve the connection from the
* ODCID without storing it in the CID tree. This is an interesting
goto err;
}
- next_sslconn = 0;
/* Compute and store into the quic_conn the hash used to compute extra CIDs */
if (quic_hash64_from_cid)
qc->hash64 = quic_hash64_from_cid(conn_id->cid.data, conn_id->cid.len,
else
HA_ATOMIC_INC(&prx_counters->dropped_pkt);
- if (next_sslconn)
- _HA_ATOMIC_DEC(&global.sslconns);
-
TRACE_LEAVE(QUIC_EV_CONN_LPKT);
return NULL;
}