2010-08-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added bittorrent::packcompact() which replaces bittorrent::createcompact() and supports IPv6 addresses. Rewritten bittorrent::unpackcompact() and bittorrent::extractPeer() to support IPv6 addresses. Fixed added.f flags in ut_pex. * src/BtConstants.h * src/DHTFindNodeReplyMessage.cc * src/DHTGetPeersReplyMessage.cc * src/DHTMessageFactoryImpl.cc * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableSerializer.cc * src/DHTTokenTracker.cc * src/DefaultBtAnnounce.cc * src/UTPexExtensionMessage.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * test/BittorrentHelperTest.cc * test/DHTFindNodeReplyMessageTest.cc * test/DHTGetPeersReplyMessageTest.cc * test/DHTMessageFactoryImplTest.cc * test/DHTRoutingTableSerializerTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/UTPexExtensionMessageTest.cc
This commit is contained in:
@@ -115,7 +115,8 @@ void DHTRoutingTableSerializerTest::testSerialize()
|
||||
ss.read(buf, 6);
|
||||
{
|
||||
std::pair<std::string, uint16_t> peer =
|
||||
bittorrent::unpackcompact(reinterpret_cast<const unsigned char*>(buf));
|
||||
bittorrent::unpackcompact(reinterpret_cast<const unsigned char*>(buf),
|
||||
AF_INET);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("192.168.0.1"), peer.first);
|
||||
CPPUNIT_ASSERT_EQUAL((uint16_t)6881, peer.second);
|
||||
}
|
||||
@@ -174,7 +175,8 @@ void DHTRoutingTableSerializerTest::testSerialize()
|
||||
ss.read(buf, 6);
|
||||
{
|
||||
std::pair<std::string, uint16_t> peer =
|
||||
bittorrent::unpackcompact(reinterpret_cast<const unsigned char*>(buf));
|
||||
bittorrent::unpackcompact(reinterpret_cast<const unsigned char*>(buf),
|
||||
AF_INET);
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("192.168.0.3"), peer.first);
|
||||
CPPUNIT_ASSERT_EQUAL((uint16_t)6883, peer.second);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user