Merge topic 'file-DOWNLOAD-cap-progress'
413282c0
file: Avoid runaway DOWNLOAD/UPLOAD progress reports (#14807)
This commit is contained in:
commit
c79d98b457
|
@ -2539,6 +2539,11 @@ namespace {
|
||||||
if (total > 0.0)
|
if (total > 0.0)
|
||||||
{
|
{
|
||||||
this->CurrentPercentage = static_cast<int>(value/total*100.0 + 0.5);
|
this->CurrentPercentage = static_cast<int>(value/total*100.0 + 0.5);
|
||||||
|
if(this->CurrentPercentage > 100)
|
||||||
|
{
|
||||||
|
// Avoid extra progress reports for unexpected data beyond total.
|
||||||
|
this->CurrentPercentage = 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool updated = (OldPercentage != this->CurrentPercentage);
|
bool updated = (OldPercentage != this->CurrentPercentage);
|
||||||
|
|
Loading…
Reference in New Issue