mirror of
https://github.com/aria2/aria2.git
synced 2025-04-06 05:57:36 +03:00
2008-10-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added length equality test to operator== to drop a piece message whose length does not match to the requested one. * src/RequestSlot.cc * test/DefaultBtMessageDispatcherTest.cc
This commit is contained in:
parent
2040d64fe5
commit
c0c80adaa2
3 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-10-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Added length equality test to operator== to drop a piece message
|
||||||
|
whose length does not match to the requested one.
|
||||||
|
* src/RequestSlot.cc
|
||||||
|
* test/DefaultBtMessageDispatcherTest.cc
|
||||||
|
|
||||||
2008-10-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-10-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Fixed the bug that aria2 aborts when a request larger than 16KiB is
|
Fixed the bug that aria2 aborts when a request larger than 16KiB is
|
||||||
|
|
|
@ -68,7 +68,8 @@ RequestSlot& RequestSlot::operator=(const RequestSlot& requestSlot)
|
||||||
|
|
||||||
bool RequestSlot::operator==(const RequestSlot& requestSlot) const
|
bool RequestSlot::operator==(const RequestSlot& requestSlot) const
|
||||||
{
|
{
|
||||||
return index == requestSlot.index && begin == requestSlot.begin;
|
return index == requestSlot.index && begin == requestSlot.begin
|
||||||
|
&& length == requestSlot.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RequestSlot::operator!=(const RequestSlot& requestSlot) const
|
bool RequestSlot::operator!=(const RequestSlot& requestSlot) const
|
||||||
|
|
|
@ -399,7 +399,7 @@ void DefaultBtMessageDispatcherTest::testGetOutstandingRequest() {
|
||||||
CPPUNIT_ASSERT(!RequestSlot::isNull(s2));
|
CPPUNIT_ASSERT(!RequestSlot::isNull(s2));
|
||||||
|
|
||||||
RequestSlot s3 = btMessageDispatcher->getOutstandingRequest(1, 1024, 17*1024);
|
RequestSlot s3 = btMessageDispatcher->getOutstandingRequest(1, 1024, 17*1024);
|
||||||
CPPUNIT_ASSERT(!RequestSlot::isNull(s3));
|
CPPUNIT_ASSERT(RequestSlot::isNull(s3));
|
||||||
|
|
||||||
RequestSlot s4 = btMessageDispatcher->getOutstandingRequest(1, 2*1024, 16*1024);
|
RequestSlot s4 = btMessageDispatcher->getOutstandingRequest(1, 2*1024, 16*1024);
|
||||||
CPPUNIT_ASSERT(RequestSlot::isNull(s4));
|
CPPUNIT_ASSERT(RequestSlot::isNull(s4));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue