diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-11-02 21:36:20 +0100 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-11-02 21:36:20 +0100 |
| commit | ba3e708dbdc6f0e3124500b79bc28aa35763580b (patch) | |
| tree | b79f3b2d2533e7445f7b5518fff66961649497fd /src/core/loader | |
| parent | d60c411ebcde5639704df3cebc3f3f50b3757e2e (diff) | |
network: fix ProxySocket receive edge cases
Routing recv() through RecvFrom made several old RecvFrom problems
reachable from the normal read path:
- A partial TCP read kept zero bytes in front of the unread data.
- A blocking read busy-waited with yield() and reported ETIMEDOUT.
- MSG_PEEK hit the flags == 0 assert.
- A UDP datagram larger than the buffer was dropped with EMSGSIZE.
Wait on a condition variable signalled when a packet arrives, and report
an expired wait as EAGAIN like an SO_RCVTIMEO timeout. Keep the existing
5s cap for sockets without a receive timeout. Allow MSG_PEEK. Truncate
oversized datagrams as BSD recv() does, and keep the unread tail of a
TCP packet for the next read.
Assisted-by: Claude Opus 5.5 (investigation and implementation)
Diffstat (limited to 'src/core/loader')
0 files changed, 0 insertions, 0 deletions
