diff --git a/docs/environment-variables.md b/docs/environment-variables.md index d5633a3..28fb251 100644 --- a/docs/environment-variables.md +++ b/docs/environment-variables.md @@ -48,7 +48,7 @@ in the inherited process environment. | `ALWAYS_USE_RELAY` 🅴 | *(none)* | `N` | `Y` forces every session through a relay (disables direct/hole‑punched connections). At runtime, send `always-use-relay Y` or `always-use-relay N` to the `hbbs` [loopback console](#runtime-console). | | `DB_URL` 🅴 | *(none)* | `./db_v2.sqlite3` | Path/URL of the SQLite database file. See [Database](#database). | | `MAX_DATABASE_CONNECTIONS` 🅴 | *(none)* | `1` | Size of the SQLite connection pool. | -| `MAX_PUNCH_REQUESTS` 🅴 | *(none)* | `10000` | Number of punch-request records kept in memory for the `punch-requests` [console](#runtime-console) command; the oldest is dropped when full. `0` disables recording. | +| `MAX_PUNCH_REQUESTS` 🅴 | *(none)* | `100000` | Number of punch-request records kept in memory for the `punch-requests` [console](#runtime-console) command; the oldest is dropped when full. `0` disables recording. | 🅴 = set through the inherited process environment. diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs index 54d24a2..a64990e 100644 --- a/src/rendezvous_server.rs +++ b/src/rendezvous_server.rs @@ -69,7 +69,7 @@ struct PunchReqEntry { tm: Instant, from_ip: String, to_ip: String, to_id: Strin static PUNCH_REQS: Lazy>> = Lazy::new(|| TokioMutex::new(VecDeque::new())); const PUNCH_REQ_DEDUPE_SEC: u64 = 60; static PUNCH_REQ_MAX: Lazy = - Lazy::new(|| get_arg("MAX_PUNCH_REQUESTS").parse().unwrap_or(10_000)); + Lazy::new(|| get_arg("MAX_PUNCH_REQUESTS").parse().unwrap_or(100_000)); async fn record_punch_req(from_ip: String, to_ip: String, to_id: String) { let max = *PUNCH_REQ_MAX;