mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Return empty range if byte-range-resp-spec or instance-length is "*" in Content-Range header to prevent aria2 from emitting error failing to convert "*" to a integer. * src/HttpHeader.cc * test/HttpHeaderTest.cc
This commit is contained in:
parent
2b458da480
commit
35cc4ed1e7
3 changed files with 36 additions and 0 deletions
|
@ -45,6 +45,26 @@ void HttpHeaderTest::testGetRange()
|
|||
CPPUNIT_ASSERT_EQUAL((off_t)9223372036854775801LL, range->getEndByte());
|
||||
CPPUNIT_ASSERT_EQUAL((uint64_t)9223372036854775807ULL, range->getEntityLength());
|
||||
}
|
||||
{
|
||||
HttpHeader httpHeader;
|
||||
httpHeader.put("Content-Range", "bytes */1024");
|
||||
|
||||
SharedHandle<Range> range = httpHeader.getRange();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((off_t)0, range->getStartByte());
|
||||
CPPUNIT_ASSERT_EQUAL((off_t)0, range->getEndByte());
|
||||
CPPUNIT_ASSERT_EQUAL((uint64_t)0, range->getEntityLength());
|
||||
}
|
||||
{
|
||||
HttpHeader httpHeader;
|
||||
httpHeader.put("Content-Range", "bytes 0-9/*");
|
||||
|
||||
SharedHandle<Range> range = httpHeader.getRange();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((off_t)0, range->getStartByte());
|
||||
CPPUNIT_ASSERT_EQUAL((off_t)0, range->getEndByte());
|
||||
CPPUNIT_ASSERT_EQUAL((uint64_t)0, range->getEntityLength());
|
||||
}
|
||||
}
|
||||
|
||||
void HttpHeaderTest::testGet()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue