/* TODO Retry should be automatically activated if
* suspect network usage is detected.
*/
- if (l->bind_conf->quic_force_retry && global.cluster_secret) {
+ if (global.cluster_secret) {
if (!token_len) {
- TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
- if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
- TRACE_PROTO("Error during Retry generation", QUIC_EV_CONN_LPKT);
+ if (l->bind_conf->quic_force_retry) {
+ TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
+ if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
+ TRACE_PROTO("Error during Retry generation", QUIC_EV_CONN_LPKT);
+ goto err;
+ }
+
+ HA_ATOMIC_INC(&prx_counters->retry_sent);
goto err;
}
-
- HA_ATOMIC_INC(&prx_counters->retry_sent);
- goto err;
}
else {
if (*buf == QUIC_TOKEN_FMT_RETRY) {
goto drop;
}
+ if (global.cluster_secret && !pkt->token_len && !l->bind_conf->quic_force_retry &&
+ HA_ATOMIC_LOAD(&prx_counters->conn_opening) >= global.tune.quic_retry_threshold) {
+ TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
+ if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
+ TRACE_PROTO("Error during Retry generation", QUIC_EV_CONN_LPKT);
+ goto err;
+ }
+
+ HA_ATOMIC_INC(&prx_counters->retry_sent);
+ goto err;
+ }
+
/* RFC 9000 7.2. Negotiating Connection IDs:
* When an Initial packet is sent by a client that has not previously
* received an Initial or Retry packet from the server, the client