Extend maximum BitTorrent incoming payload size to 64KiB

This commit is contained in:
Tatsuhiro Tsujikawa 2016-07-20 22:42:29 +09:00
parent 537b8659d2
commit 9a63e59104
3 changed files with 6 additions and 4 deletions

View file

@ -266,7 +266,7 @@ void BtRequestMessageTest::testValidate()
void BtRequestMessageTest::testValidate_lengthTooLong()
{
BtRequestMessage msg(0, 0, 32_k + 1);
BtRequestMessage msg(0, 0, MAX_BLOCK_LENGTH + 1);
msg.setBtMessageValidator(
make_unique<RangeBtMessageValidator>(&msg, 1_k, 256_k));
try {
@ -274,7 +274,9 @@ void BtRequestMessageTest::testValidate_lengthTooLong()
CPPUNIT_FAIL("exception must be thrown.");
}
catch (DlAbortEx& e) {
CPPUNIT_ASSERT_EQUAL(std::string("Length too long: 32769 > 32KB"),
CPPUNIT_ASSERT_EQUAL("Length too long: " +
util::uitos(MAX_BLOCK_LENGTH + 1) + " > " +
util::uitos(MAX_BLOCK_LENGTH / 1024) + "KB",
std::string(e.what()));
}
}