wxUpdCheckThread::DownloadUpdatePackage() does the file-existence check before calculating hash, to avoid unnecessary warning in the log
This commit is contained in:
parent
ff28695e80
commit
66b2934da8
@ -394,18 +394,20 @@ bool wxUpdCheckThread::ReadUpdatePackageMeta()
|
|||||||
|
|
||||||
bool wxUpdCheckThread::DownloadUpdatePackage()
|
bool wxUpdCheckThread::DownloadUpdatePackage()
|
||||||
{
|
{
|
||||||
// Calculate file hash (if exists).
|
if (wxFileExists(m_fileName)) {
|
||||||
wxCryptoHashSHA1 ch(*m_cs);
|
// Calculate file hash.
|
||||||
if (ch.HashFile(m_fileName)) {
|
wxCryptoHashSHA1 ch(*m_cs);
|
||||||
wxMemoryBuffer buf;
|
if (ch.HashFile(m_fileName)) {
|
||||||
ch.GetValue(buf);
|
wxMemoryBuffer buf;
|
||||||
|
ch.GetValue(buf);
|
||||||
|
|
||||||
if (buf.GetDataLen() == m_hash.GetDataLen() &&
|
if (buf.GetDataLen() == m_hash.GetDataLen() &&
|
||||||
memcmp(buf.GetData(), m_hash.GetData(), buf.GetDataLen()) == 0)
|
memcmp(buf.GetData(), m_hash.GetData(), buf.GetDataLen()) == 0)
|
||||||
{
|
{
|
||||||
// Update package file exists and its hash is correct.
|
// Update package file exists and its hash is correct.
|
||||||
wxLogStatus(_("Update package file already downloaded."));
|
wxLogStatus(_("Update package file already downloaded."));
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user