net: return copied bytes for truncated datagram receives #510

Manually merged
github merged 1 commit from gh-pr/510/head into gh-pr/510/base 2026-11-26 09:24:21 +00:00
Owner

@⁠MehmetCambaz on GitHub · 2026-09-08 13:49 UTC · original
MehmetCambaz:fix/udp-truncated-receive → main · +12 −7 · 1 files · 1 commits · merged 2026-09-12 13:51 UTC

On Windows, receiving an 8-byte UDP datagram into a 3-byte buffer returns WSAEMSGSIZE even though Winsock copied the first 3 bytes. Return that copied length to the guest and convert the sender address after handling truncation. Other receive errors and send errors retain their existing handling.

The patch changes only src/libs/network.cpp. No test files or CMake/CTest changes are included.

Validation: the unchanged production fix compiled with Clang on Linux and passed the datagram and full filesystem checks before their test additions were removed from the patch. git diff --check passes. Native Windows execution was not rerun, so those Linux checks do not validate the Windows-specific branch.

**@⁠MehmetCambaz** on GitHub · 2026-09-08 13:49 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/510) `MehmetCambaz:fix/udp-truncated-receive` → `main` · +12 −7 · 1 files · 1 commits · merged 2026-09-12 13:51 UTC On Windows, receiving an 8-byte UDP datagram into a 3-byte buffer returns `WSAEMSGSIZE` even though Winsock copied the first 3 bytes. Return that copied length to the guest and convert the sender address after handling truncation. Other receive errors and send errors retain their existing handling. The patch changes only `src/libs/network.cpp`. No test files or CMake/CTest changes are included. Validation: the unchanged production fix compiled with Clang on Linux and passed the datagram and full filesystem checks before their test additions were removed from the patch. `git diff --check` passes. Native Windows execution was not rerun, so those Linux checks do not validate the Windows-specific branch.
Normalize Winsock WSAEMSGSIZE on receive to the copied byte count before converting the peer address. Preserve other receive errors and oversized send failures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:24:21 +00:00
github manually merged commit a5ee3750c4 into gh-pr/510/base 2026-11-26 09:24:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.