diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-05-06 18:56:32 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-05-06 19:12:17 +0900 |
| commit | 5bc5665c6a7eaf95d90b78b415aea3ed00857835 (patch) | |
| tree | 1ff7d2c3dd62d77ea74c0ca934ecb1d7f7221d5e /src/HttpHeader.cc | |
| parent | 3a4acead2d49243ec3a4aa33cc8bded648b5647f (diff) | |
Support off64_t for Android build
Android NDK R8e does not provide ftruncate64, but bionic has the
assembler code to access kernel function. We borrowed those
ftruncate64.S files from android source code repository. It turns out
that x86 asm.h in NDK R8e is also broken, so latest asm.h was also
borrowed.
Diffstat (limited to 'src/HttpHeader.cc')
| -rw-r--r-- | src/HttpHeader.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 481ac1aa..4f046fce 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -100,7 +100,7 @@ Range HttpHeader::getRange() const if(!util::parseLLIntNoThrow(contentLength, clenStr) || contentLength < 0) { throw DL_ABORT_EX("Content-Length must be positive integer"); - } else if(contentLength > std::numeric_limits<off_t>::max()) { + } else if(contentLength > std::numeric_limits<a2_off_t>::max()) { throw DOWNLOAD_FAILURE_EXCEPTION (fmt(EX_TOO_LARGE_FILE, contentLength)); } else if(contentLength == 0) { @@ -146,13 +146,13 @@ Range HttpHeader::getRange() const startByte < 0 || endByte < 0 || entityLength < 0) { throw DL_ABORT_EX("byte-range-spec must be positive"); } - if(startByte > std::numeric_limits<off_t>::max()) { + if(startByte > std::numeric_limits<a2_off_t>::max()) { throw DOWNLOAD_FAILURE_EXCEPTION(fmt(EX_TOO_LARGE_FILE, startByte)); } - if(endByte > std::numeric_limits<off_t>::max()) { + if(endByte > std::numeric_limits<a2_off_t>::max()) { throw DOWNLOAD_FAILURE_EXCEPTION(fmt(EX_TOO_LARGE_FILE, endByte)); } - if(entityLength > std::numeric_limits<off_t>::max()) { + if(entityLength > std::numeric_limits<a2_off_t>::max()) { throw DOWNLOAD_FAILURE_EXCEPTION(fmt(EX_TOO_LARGE_FILE, entityLength)); } return Range(startByte, endByte, entityLength); |
