From 860f4dd06ace859470e118d4b9a8d10ddf92d076 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 23 Jul 2012 21:36:24 +0900 Subject: Use int64_t instead of off_t Using off_t, at least, in DiskAdaptor layer is problematic because torrent can contain under 2GiB files but total sum of those files may exceed 2GiB limit, which makes off_t overflow in 32 bit system without large file support. So we use int64_t in API. We'll check the file length before download so that it does not exceed max off_t. --- src/MultiFileAllocationIterator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/MultiFileAllocationIterator.cc') diff --git a/src/MultiFileAllocationIterator.cc b/src/MultiFileAllocationIterator.cc index 6b6a89fa..e45c71e6 100644 --- a/src/MultiFileAllocationIterator.cc +++ b/src/MultiFileAllocationIterator.cc @@ -95,7 +95,7 @@ bool MultiFileAllocationIterator::finished() (!fileAllocationIterator_ || fileAllocationIterator_->finished()); } -off_t MultiFileAllocationIterator::getCurrentLength() +int64_t MultiFileAllocationIterator::getCurrentLength() { if(!fileAllocationIterator_) { return 0; @@ -104,7 +104,7 @@ off_t MultiFileAllocationIterator::getCurrentLength() } } -off_t MultiFileAllocationIterator::getTotalLength() +int64_t MultiFileAllocationIterator::getTotalLength() { if(!fileAllocationIterator_) { return 0; -- cgit