Merge pull request #7871 from Learath2/dd_pr_oopsie

Fix client/server updates
This commit is contained in:
Dennis Felsing 2024-01-29 10:40:40 +00:00 committed by GitHub
commit 9a8541648c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View file

@ -84,6 +84,8 @@ CUpdater::CUpdater()
m_Percent = 0;
m_pCurrentTask = nullptr;
m_ClientUpdate = m_ServerUpdate = m_ClientFetched = m_ServerFetched = false;
IStorage::FormatTmpPath(m_aClientExecTmp, sizeof(m_aClientExecTmp), CLIENT_EXEC);
IStorage::FormatTmpPath(m_aServerExecTmp, sizeof(m_aServerExecTmp), SERVER_EXEC);
}
@ -345,17 +347,17 @@ void CUpdater::RunningUpdate()
}
else
{
if(m_ServerUpdate)
if(m_ServerUpdate && !m_ServerFetched)
{
FetchFile(PLAT_SERVER_DOWN, m_aServerExecTmp);
m_ServerUpdate = false;
m_ServerFetched = true;
return;
}
if(m_ClientUpdate)
if(m_ClientUpdate && !m_ClientFetched)
{
FetchFile(PLAT_SERVER_DOWN, m_aServerExecTmp);
m_ClientUpdate = false;
FetchFile(PLAT_CLIENT_DOWN, m_aClientExecTmp);
m_ClientFetched = true;
return;
}

View file

@ -65,6 +65,9 @@ class CUpdater : public IUpdater
bool m_ClientUpdate;
bool m_ServerUpdate;
bool m_ClientFetched;
bool m_ServerFetched;
void AddFileJob(const char *pFile, bool Job);
void FetchFile(const char *pFile, const char *pDestPath = nullptr) REQUIRES(!m_Lock);
bool MoveFile(const char *pFile);