From 6096dd75b28dd28472da3cc158ea8bf34d1f9589 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sat, 18 Jun 2022 22:07:22 +0100 Subject: [PATCH] Handle the case where byte optionValues are sent to BSD Some games and the Mario Odyssey Multiplayer mod do this. The SMO multiplayer mod also needs you to revert #3394 as it uses a blocking socket to receive (otherwise it hangs), and it doesn't seem to like being forced as non-blocking. --- Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs index 349dbde0a..43172ab4c 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs @@ -304,7 +304,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd return LinuxError.EOPNOTSUPP; } - int value = MemoryMarshal.Read(optionValue); + int value = optionValue.Length >= 4 ? MemoryMarshal.Read(optionValue) : MemoryMarshal.Read(optionValue); if (option == BsdSocketOption.SoLinger) {