diff --git a/demo/demo_server.c b/demo/demo_server.c index f1670453..4a14062b 100644 --- a/demo/demo_server.c +++ b/demo/demo_server.c @@ -1525,7 +1525,7 @@ xqc_demo_svr_init_conn_settings(xqc_engine_t *engine, xqc_demo_svr_args_t *args) .is_interop_mode = args->quic_cfg.is_interop_mode, .max_pkt_out_size = args->quic_cfg.max_pkt_sz, .adaptive_ack_frequency = 1, - .anti_amplification_limit = 3, + .anti_amplification_limit = 4, }; xqc_server_set_conn_settings(engine, &conn_settings); diff --git a/src/transport/xqc_conn.c b/src/transport/xqc_conn.c index bc1daa65..6ab4e759 100644 --- a/src/transport/xqc_conn.c +++ b/src/transport/xqc_conn.c @@ -175,7 +175,8 @@ xqc_server_set_conn_settings(xqc_engine_t *engine, const xqc_conn_settings_t *se engine->default_conn_settings.idle_time_out = settings->idle_time_out; } - if (settings->anti_amplification_limit > XQC_DEFAULT_ANTI_AMPLIFICATION_LIMIT) { + /* default value: 5x, it could be set to meet application need */ + if (settings->anti_amplification_limit > 0) { engine->default_conn_settings.anti_amplification_limit = settings->anti_amplification_limit; } @@ -692,7 +693,7 @@ xqc_conn_create(xqc_engine_t *engine, xqc_cid_t *dcid, xqc_cid_t *scid, xc->conn_settings.idle_time_out = XQC_CONN_DEFAULT_IDLE_TIMEOUT; } - if (xc->conn_settings.anti_amplification_limit < XQC_DEFAULT_ANTI_AMPLIFICATION_LIMIT) { + if (xc->conn_settings.anti_amplification_limit == 0) { xc->conn_settings.anti_amplification_limit = XQC_DEFAULT_ANTI_AMPLIFICATION_LIMIT; }