[PATCH] ws2_32: Ignore a SO_SNDBUF value of 0 on macOS.

Hans Leidekker hans at codeweavers.com
Mon Nov 19 02:33:31 CST 2018


From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40264
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/ws2_32/socket.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index df068fe852..2ac6b9fec5 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -5808,6 +5808,17 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
             optlen = sizeof(struct linger);
             break;
 
+        case WS_SO_SNDBUF:
+            if (!*(const int *)optval)
+            {
+                FIXME("SO_SNDBUF ignoring request to disable send buffering\n");
+#ifdef __APPLE__
+                return 0;
+#endif
+            }
+            convert_sockopt(&level, &optname);
+            break;
+
         case WS_SO_RCVBUF:
             if (*(const int*)optval < 2048)
             {
@@ -5828,7 +5839,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
          * however, using it the BSD way fixes bug 8513 and seems to be what
          * most programmers assume, anyway */
         case WS_SO_REUSEADDR:
-        case WS_SO_SNDBUF:
         case WS_SO_TYPE:
             convert_sockopt(&level, &optname);
             break;
-- 
2.11.0




More information about the wine-devel mailing list