From 0ca560ced82ca434f438490427c4913b115a8e95 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 19 Jul 2024 03:39:37 -0500 Subject: [PATCH] Fix invalid parameter passed to WSASendMsg() (#2890) The third parameter is for flags, not number of messages. --- src/platform/windows/misc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/windows/misc.cpp b/src/platform/windows/misc.cpp index 465a0085..a4190e01 100644 --- a/src/platform/windows/misc.cpp +++ b/src/platform/windows/misc.cpp @@ -1537,7 +1537,7 @@ namespace platf { // If USO is not supported, this will fail and the caller will fall back to unbatched sends. DWORD bytes_sent; - return WSASendMsg((SOCKET) send_info.native_socket, &msg, 1, &bytes_sent, nullptr, nullptr) != SOCKET_ERROR; + return WSASendMsg((SOCKET) send_info.native_socket, &msg, 0, &bytes_sent, nullptr, nullptr) != SOCKET_ERROR; } bool @@ -1614,7 +1614,7 @@ namespace platf { msg.Control.len = cmbuflen; DWORD bytes_sent; - if (WSASendMsg((SOCKET) send_info.native_socket, &msg, 1, &bytes_sent, nullptr, nullptr) == SOCKET_ERROR) { + if (WSASendMsg((SOCKET) send_info.native_socket, &msg, 0, &bytes_sent, nullptr, nullptr) == SOCKET_ERROR) { auto winerr = WSAGetLastError(); BOOST_LOG(warning) << "WSASendMsg() failed: "sv << winerr; return false;