From 2cc471ebf6600f11c6af07e4e968778c2c470b0b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 20 Feb 2008 13:02:48 +0000 Subject: 2008-02-20 Tatsuhiro Tsujikawa IPv6 support for SocketCore class. TODO: In SocketCore::establishConnection(), this is insufficient to determin the failure of connect() here because the socket is non-blocking state. The next addresses should be tried after select(). TODO: NameResolver still uses c-ares(<= 1.4) ares_gethostbyname(). If c-ares 1.5 or newer is installed, ares_getaddrinfo() should be used instead which address family independent. TODO: DHTRoutingTable{Deserializer,Serializer} currently saves peer information in a compact peer format which is for IPv4 only. Some BitTorrent functions in PeerMessageUtil still depends on IPv4 but this is a spec of BitTorrent protocol. * src/SocketCore.{h, cc} * src/PeerMessageUtil.cc * test/SocketCoreTest.cc * test/PeerMessageUtilTest.cc * test/DHTConnectionImplTest.cc Handle IPv4-mapped addresses. * src/DHTNode.cc: Now identity is determined by node id. * src/DHTMessageTrackerEntry.cc Because now PeerMessageUtil::unpackcompact() could fail, the caller should handle it. * src/DHTRoutingTableDeserializer.cc * src/DHTMessageFactoryImpl.cc --- test/DHTConnectionImplTest.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/DHTConnectionImplTest.cc') diff --git a/test/DHTConnectionImplTest.cc b/test/DHTConnectionImplTest.cc index a6c8544d..7c3b6f36 100644 --- a/test/DHTConnectionImplTest.cc +++ b/test/DHTConnectionImplTest.cc @@ -29,14 +29,13 @@ void DHTConnectionImplTest::testWriteAndReadData() uint16_t con2port = con2.bind(0); std::string message1 = "hello world."; - con1.sendMessage(message1.c_str(), message1.size(), "localhost", con2port); + con1.sendMessage(message1.c_str(), message1.size(), "127.0.0.1", con2port); char readbuffer[100]; std::string remoteHost; uint16_t remotePort; { ssize_t rlength = con2.receiveMessage(readbuffer, sizeof(readbuffer), remoteHost, remotePort); - CPPUNIT_ASSERT_EQUAL(std::string("127.0.0.1"), remoteHost); CPPUNIT_ASSERT_EQUAL((ssize_t)message1.size(), rlength); readbuffer[rlength] = '\0'; CPPUNIT_ASSERT_EQUAL(message1, std::string(readbuffer)); -- cgit