From 1bab3276e9cf97ab3e5ad22a5eea88fe628376b9 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Tue, 5 Apr 2022 10:58:42 +0200 Subject: [PATCH] fix setsockopt SO_SNDTIMEO for windows, bump version number to 3.0.2, update commandline --- deps/commandline | 2 +- include/Common.h | 4 ++-- src/TNetwork.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deps/commandline b/deps/commandline index 01434c1..b1da8bc 160000 --- a/deps/commandline +++ b/deps/commandline @@ -1 +1 @@ -Subproject commit 01434c11aaf82d37a126dc70f5aa02cc523dbbb4 +Subproject commit b1da8bcb696bfa9388dca46bf0f5dd9538fc70aa diff --git a/include/Common.h b/include/Common.h index 5d224fb..8861a77 100644 --- a/include/Common.h +++ b/include/Common.h @@ -7,12 +7,12 @@ extern TSentry Sentry; #include #include #include +#include #include #include #include #include #include -#include #include "Compat.h" @@ -121,7 +121,7 @@ private: static inline std::mutex mShutdownHandlersMutex {}; static inline std::deque mShutdownHandlers {}; - static inline Version mVersion { 3, 0, 1 }; + static inline Version mVersion { 3, 0, 2 }; }; std::string ThreadName(bool DebugModeOverride = false); diff --git a/src/TNetwork.cpp b/src/TNetwork.cpp index 0af4f49..03c90f1 100644 --- a/src/TNetwork.cpp +++ b/src/TNetwork.cpp @@ -154,10 +154,10 @@ void TNetwork::TCPServerMain() { beammp_warn(("Got an invalid client socket on connect! Skipping...")); continue; } - // set timeout - size_t SendTimeoutMS = 30 * 1000; + // set timeout (DWORD, aka uint32_t) + uint32_t SendTimeoutMS = 30 * 1000; #if defined(BEAMMP_WINDOWS) - int ret = ::setsockopt(client.Socket, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast(&ms), sizeof(ms)); + int ret = ::setsockopt(client.Socket, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast(&SendTimeoutMS), sizeof(SendTimeoutMS)); #else // POSIX struct timeval optval; optval.tv_sec = (int)(SendTimeoutMS / 1000);