aboutsummaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-11-03 01:15:29 +0100
committercirakg <cirakg@cirakg.xyz>2026-11-03 01:15:29 +0100
commitd6b32aac3c75a6a0c4190a8b6b2b1fbc5f3e8801 (patch)
treed31c2c69918784470e2b7083d1d9b37b5d011d69 /src/core/memory.cpp
parent5979ca6569f3db076bbcb7808bea6a41a5b6928c (diff)
network: keep fcntl modes across MSG_DONTWAIT and decompress room packets once
A receive with MSG_DONTWAIT restored the blocking mode from the descriptor copy taken before the call. When fcntl(SETFL, O_NONBLOCK) ran during the receive, the fd kept reporting O_NONBLOCK while its socket blocked again. Receives now switch the mode only for MSG_DONTWAIT and read the current flags under file_descriptors_mutex at both ends, and SETFL changes the mode and the stored flags in the same critical section. OnProxyPacketReceived decompressed each room packet once per matching socket while holding file_descriptors_mutex, so every bsd call waited for it. It now copies the distinct sockets under the lock, decompresses once without it and delivers the result. Also reject fd == MAX_FD in IsFileDescriptorValid and PollImpl, which read past the table, and guard the ProxySocket blocking and receive timeout setters with packets_mutex, matching their reader. Assisted-by: Claude Opus 5.5 (investigation and implementation)
Diffstat (limited to 'src/core/memory.cpp')
0 files changed, 0 insertions, 0 deletions