summaryrefslogtreecommitdiff
path: root/src/message_digest_helper.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-23 21:36:24 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-23 21:42:47 +0900
commit860f4dd06ace859470e118d4b9a8d10ddf92d076 (patch)
tree1effdc3fd73160b57f5d6d109662a66e33050d08 /src/message_digest_helper.h
parentf56743b0833551aa6845d0a4f1d05da02cb52175 (diff)
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.
Diffstat (limited to 'src/message_digest_helper.h')
-rw-r--r--src/message_digest_helper.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/message_digest_helper.h b/src/message_digest_helper.h
index b6179d92..e31e8586 100644
--- a/src/message_digest_helper.h
+++ b/src/message_digest_helper.h
@@ -63,7 +63,7 @@ void staticSHA1DigestInit();
void staticSHA1DigestFree();
std::string staticSHA1Digest
-(const SharedHandle<BinaryStream>& bs, off_t offset, off_t length);
+(const SharedHandle<BinaryStream>& bs, int64_t offset, int64_t length);
/**
* ctx must be initialized or reseted before calling this function.
@@ -72,7 +72,7 @@ std::string staticSHA1Digest
std::string digest
(const SharedHandle<MessageDigest>& ctx,
const SharedHandle<BinaryStream>& bs,
- off_t offset, off_t length);
+ int64_t offset, int64_t length);
/**
* Stores *raw* message digest into md.