aboutsummaryrefslogtreecommitdiff
path: root/src/tests/common/bit_utils.cpp
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-11-03 01:15:30 +0100
committercirakg <cirakg@cirakg.xyz>2026-11-03 01:15:30 +0100
commit9b56bf38cb92c42abd776d95bdd61f96bf9d1e9a (patch)
tree7c1d77b2475c5e650ca365d4d01f8db899d6f386 /src/tests/common/bit_utils.cpp
parent01090e8e44d8d64bb5839f8d842bdd3028447608 (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/tests/common/bit_utils.cpp')
0 files changed, 0 insertions, 0 deletions