Skip to content

Commit 397ba87

Browse files
committed
Fix TorrentDownloader progress reporting for big files
The problem was caused by integer overflow.
1 parent 9a22fbf commit 397ba87

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Assets/PatchKit Patcher/Scripts/AppData/Remote/Downloaders/TorrentDownloader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private void CheckTimeout(double progress)
151151

152152
private void UpdateTorrentProgress(double progress)
153153
{
154-
OnDownloadProgressChanged(Mathf.CeilToInt(_resource.Size * (float)progress), _resource.Size);
154+
OnDownloadProgressChanged((long)(_resource.Size * progress), _resource.Size);
155155
}
156156

157157
private bool UpdateTorrentStatus()

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [Unreleased]
8+
### Fixed
9+
- HTTP downloader resumes the download on error
10+
- Fix TorrentDownloader progress reporting for big files
11+
712
## [3.1.3]
813
### Added
914
- Add miliseconds information to log date and time

0 commit comments

Comments
 (0)