Skip to content

handle incomplete MSG_WAITALL during tcp receive#248

Open
Kethen wants to merge 4 commits into
BeamMP:masterfrom
Kethen:tcp_recv_fix
Open

handle incomplete MSG_WAITALL during tcp receive#248
Kethen wants to merge 4 commits into
BeamMP:masterfrom
Kethen:tcp_recv_fix

Conversation

@Kethen
Copy link
Copy Markdown

@Kethen Kethen commented Apr 28, 2026

Addresses #185 by handling incomplete TCP recv despite MSG_WAITALL

Fixes running the launcher inside of wine as well as the rare instances where this happens natively.

       MSG_WAITALL (since Linux 2.2)
              This flag requests that the operation block until the full request is satisfied.
              However, the call may still return less data than requested if a signal is caught,
              an error or disconnect occurs, or the next data to  be  re‐ceived is of a different type
              than that returned.  This flag has no effect for datagram sockets.


By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion.
I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.

@Kethen
Copy link
Copy Markdown
Author

Kethen commented May 11, 2026

Added size checks for TCP MSG_WAITALL recv when incoming sizes are known

@Neptnium
Copy link
Copy Markdown

@Kethen Just tested your most recent changes !
With the poc mentioned in #185 it still crashed with the logs:

...
[23/5/2026 20:18:42] [DEBUG] (Proxy) Game Connected!
[23/5/2026 20:18:42] [DEBUG] Starting UDP receive loop
[23/5/2026 20:18:43] [ERROR] zlib uncompress() failed (code: -3, message: data error)
[23/5/2026 20:18:43] [ERROR] Decompression failed

(This was tested on Windows 11)

@Kethen
Copy link
Copy Markdown
Author

Kethen commented May 23, 2026

@Kethen Just tested your most recent changes ! With the poc mentioned in #185 it still crashed with the logs:

...
[23/5/2026 20:18:42] [DEBUG] (Proxy) Game Connected!
[23/5/2026 20:18:42] [DEBUG] Starting UDP receive loop
[23/5/2026 20:18:43] [ERROR] zlib uncompress() failed (code: -3, message: data error)
[23/5/2026 20:18:43] [ERROR] Decompression failed

(This was tested on Windows 11)

Interesting, that'd suggest unlike in WINE, when Windows sees the message, the data it received is truly invalid data

How did you reproduce the error in your testing? With the POC server plugin?

@Neptnium
Copy link
Copy Markdown

@Kethen exactly, I used the POV server plugin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants