net: drop MSG_WAITALL when combined with MSG_PEEK on Windows #508

Closed
github-bot wants to merge 1 commit from gh-pr/508/head into gh-pr/508/base
Owner

@⁠FirasDev on GitHub · 2026-09-07 22:15 UTC · original
FirasDev:fix-windows-peek-waitall → main · +7 −1 · 1 files · 1 commits · closed without merging

Fixes #505.

Winsock's recv() doesn't support MSG_PEEK and MSG_WAITALL together —
POSIX allows it, Windows doesn't. These got merged into one shared
code path in 46850f9, which broke kernel_file_system on Windows
(the new CheckSocketWakeup check specifically).

Fix drops WAITALL on Windows when PEEK is also set, same as the
existing DONTWAIT/NOSIGNAL carve-out a few lines above it in
ConvertMessageFlags. Worth noting this means Windows won't actually
block for the full length when peeking data that hasn't fully
arrived yet across multiple segments — fine for this test and the
common case, but not a complete WAITALL emulation. Open to doing the
fuller loop-based version instead if that's preferred.

Ran the full test suite locally on Windows/clang-cl before and after:
kernel_file_system was the only failure before (matching #505
exactly), zero failures after.

Used AI to help track down the root cause and draft the diff; reviewed
the change and ran the tests myself before opening this.

**@⁠FirasDev** on GitHub · 2026-09-07 22:15 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/508) `FirasDev:fix-windows-peek-waitall` → `main` · +7 −1 · 1 files · 1 commits · closed without merging Fixes #505. Winsock's recv() doesn't support MSG_PEEK and MSG_WAITALL together — POSIX allows it, Windows doesn't. These got merged into one shared code path in 46850f9, which broke kernel_file_system on Windows (the new CheckSocketWakeup check specifically). Fix drops WAITALL on Windows when PEEK is also set, same as the existing DONTWAIT/NOSIGNAL carve-out a few lines above it in ConvertMessageFlags. Worth noting this means Windows won't actually block for the full length when peeking data that hasn't fully arrived yet across multiple segments — fine for this test and the common case, but not a complete WAITALL emulation. Open to doing the fuller loop-based version instead if that's preferred. Ran the full test suite locally on Windows/clang-cl before and after: kernel_file_system was the only failure before (matching #505 exactly), zero failures after. Used AI to help track down the root cause and draft the diff; reviewed the change and ran the tests myself before opening this.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:24:16 +00:00
github-bot closed this pull request 2026-11-26 09:24:16 +00:00
Author
Owner

@⁠Nmzik on GitHub · 2026-10-03 17:16 UTC · original

Credited

**@⁠Nmzik** on GitHub · 2026-10-03 17:16 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/508#issuecomment-5971559118) Credited

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.