mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-03 05:38:51 +00:00
Update HttpClientHelper.cs
This commit is contained in:
parent
62e796cf5a
commit
9654009650
1 changed files with 10 additions and 2 deletions
|
@ -215,10 +215,10 @@ namespace v2rayN.Base
|
||||||
// TODO:
|
// TODO:
|
||||||
totalRead += read;
|
totalRead += read;
|
||||||
|
|
||||||
|
TimeSpan ts = (DateTime.Now - totalDatetime);
|
||||||
|
var speed = totalRead * 1d / ts.TotalMilliseconds / 1000;
|
||||||
if (canReportProgress)
|
if (canReportProgress)
|
||||||
{
|
{
|
||||||
TimeSpan ts = (DateTime.Now - totalDatetime);
|
|
||||||
var speed = totalRead * 1d / ts.TotalMilliseconds / 1000;
|
|
||||||
var percent = Convert.ToInt32((totalRead * 1d) / (total * 1d) * 100);
|
var percent = Convert.ToInt32((totalRead * 1d) / (total * 1d) * 100);
|
||||||
if (progressPercentage != percent)
|
if (progressPercentage != percent)
|
||||||
{
|
{
|
||||||
|
@ -226,6 +226,14 @@ namespace v2rayN.Base
|
||||||
progress.Report(speed);
|
progress.Report(speed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (progress != null)
|
||||||
|
{
|
||||||
|
if (progressPercentage != Convert.ToInt32(speed * 10))
|
||||||
|
{
|
||||||
|
progressPercentage = Convert.ToInt32(speed * 10);
|
||||||
|
progress.Report(speed);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} while (isMoreToRead);
|
} while (isMoreToRead);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue