Fix invalid parameter passed to WSASendMsg() (#2890)

The third parameter is for flags, not number of messages.
This commit is contained in:
Cameron Gutman 2024-07-19 03:39:37 -05:00 committed by GitHub
parent 3935d305ae
commit 0ca560ced8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;