mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
Introduce a main-process SSH transport registry (borrow/return leases, ControlPersist-style idle park) shared by shell, SFTP, transfer, and port-forward. Transfer pool becomes channel concurrency only; remove the separate transfer-pool idle TTL UI in favor of a single SSH keep-alive setting. Register dedicated SFTP dials, reuse parked transports, and fix TTL 0 (park until quit), jump-host endpoint keys, and remote unforwardIn.
19 lines
709 B
TypeScript
19 lines
709 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import {
|
|
DEFAULT_SSH_TRANSPORT_IDLE_TTL_MS,
|
|
resolveSshTransportIdleTtlMs,
|
|
} from "./sshTransportIdleTtl.ts";
|
|
|
|
test("ssh transport idle TTL defaults to 5 minutes", () => {
|
|
assert.equal(DEFAULT_SSH_TRANSPORT_IDLE_TTL_MS, 5 * 60_000);
|
|
assert.equal(resolveSshTransportIdleTtlMs(() => null), DEFAULT_SSH_TRANSPORT_IDLE_TTL_MS);
|
|
});
|
|
|
|
test("ssh transport idle TTL accepts presets including never-reclaim", () => {
|
|
assert.equal(resolveSshTransportIdleTtlMs(() => 60_000), 60_000);
|
|
assert.equal(resolveSshTransportIdleTtlMs(() => 0), 0);
|
|
assert.equal(resolveSshTransportIdleTtlMs(() => 123), DEFAULT_SSH_TRANSPORT_IDLE_TTL_MS);
|
|
});
|