mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-02 22:06:29 +00:00
add extra layer of checks for data races in download
yeah
This commit is contained in:
@@ -217,6 +217,13 @@ std::vector<char> MultiDownload(SOCKET MSock, SOCKET DSock, uint64_t Size, const
|
||||
return {};
|
||||
}
|
||||
|
||||
// ensure that GRcv is good before joining the async update thread
|
||||
GRcv = MData.size() + DData.size();
|
||||
if (GRcv != Size) {
|
||||
error("Something went wrong during download; didn't get enough data. Expected " + std::to_string(Size) + " bytes, got " + std::to_string(GRcv) + " bytes instead");
|
||||
return {};
|
||||
}
|
||||
|
||||
Au.join();
|
||||
|
||||
std::vector<char> Result{};
|
||||
|
||||
Reference in New Issue
Block a user