mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-10-12 03:34:26 +00:00
feat(hbbs): keep 100000 punch-request records by default
With peer ids capped at 253 bytes a full store is roughly 45 MB at worst, so a larger default keeps more console history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9dfa0610e0
commit
b0a07de9be
@@ -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). |
|
| `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). |
|
| `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_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.
|
🅴 = set through the inherited process environment.
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ struct PunchReqEntry { tm: Instant, from_ip: String, to_ip: String, to_id: Strin
|
|||||||
static PUNCH_REQS: Lazy<TokioMutex<VecDeque<PunchReqEntry>>> = Lazy::new(|| TokioMutex::new(VecDeque::new()));
|
static PUNCH_REQS: Lazy<TokioMutex<VecDeque<PunchReqEntry>>> = Lazy::new(|| TokioMutex::new(VecDeque::new()));
|
||||||
const PUNCH_REQ_DEDUPE_SEC: u64 = 60;
|
const PUNCH_REQ_DEDUPE_SEC: u64 = 60;
|
||||||
static PUNCH_REQ_MAX: Lazy<usize> =
|
static PUNCH_REQ_MAX: Lazy<usize> =
|
||||||
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) {
|
async fn record_punch_req(from_ip: String, to_ip: String, to_id: String) {
|
||||||
let max = *PUNCH_REQ_MAX;
|
let max = *PUNCH_REQ_MAX;
|
||||||
|
|||||||
Reference in New Issue
Block a user