aboutsummaryrefslogtreecommitdiff
path: root/src/common/key_map.cpp
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-11-03 00:46:55 +0100
committercirakg <cirakg@cirakg.xyz>2026-11-03 00:46:55 +0100
commita7e03702c10290dd46bc40e46599729510eda458 (patch)
tree2416fb91b0ab3a512560b29e4a974df8ea6d1215 /src/common/key_map.cpp
parentef216e48f57ec73dbc5683aac7b85f2e0b0b611c (diff)
network: keep bsd sockets alive across concurrent close and fix room gaps
bsd runs on three host threads, but its calls kept a raw reference into the shared descriptor table while they used a socket. A close() on another thread could then destroy the socket mid-call. Waking a blocked room recv() on close made this happen every time. Every call now works on a copy of the descriptor taken under the table lock, poll() keeps its sockets alive while it waits, and close() resets the slot only if it still holds the same socket. accept() picked a free fd before blocking and only locked the write, so another thread could publish a socket in the same slot. It now picks and writes the fd in one critical section after Accept() returns. dup() now re-checks the source fd under the lock. A duplicated fd shares its socket, so the room packet loop queued each packet once per fd. Deliver it once per socket. NIFM: when the selected host adapter is missing, the room still works and IsNetworkAvailable reports it, but GetCurrentNetworkProfile returned an empty profile. Report a wired room profile in that case, and put the room address on the first adapter in EnumerateNetworkInterfaces. Assisted-by: Claude Opus 5.5 (investigation and implementation)
Diffstat (limited to 'src/common/key_map.cpp')
0 files changed, 0 insertions, 0 deletions