mirror of https://github.com/aria2/aria2
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.ccpull/1/head
parent
2040d64fe5
commit
c0c80adaa2
|
@ -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>
|
||||
|
||||
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
|
||||
{
|
||||
return index == requestSlot.index && begin == requestSlot.begin;
|
||||
return index == requestSlot.index && begin == requestSlot.begin
|
||||
&& length == requestSlot.length;
|
||||
}
|
||||
|
||||
bool RequestSlot::operator!=(const RequestSlot& requestSlot) const
|
||||
|
|
|
@ -399,7 +399,7 @@ void DefaultBtMessageDispatcherTest::testGetOutstandingRequest() {
|
|||
CPPUNIT_ASSERT(!RequestSlot::isNull(s2));
|
||||
|
||||
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);
|
||||
CPPUNIT_ASSERT(RequestSlot::isNull(s4));
|
||||
|
|
Loading…
Reference in New Issue