diff options
author | Tobias Markmann <tm@ayena.de> | 2015-12-09 15:24:23 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-01-12 17:42:50 (GMT) |
commit | 13801557b6664426cac26384441ab0b19ff9abb5 (patch) | |
tree | 924c5d47e157612e0492f29806910828fe38871f /Swiften/FileTransfer | |
parent | e314293415c9691bb98188b514f6b13e33994d86 (diff) | |
download | swift-13801557b6664426cac26384441ab0b19ff9abb5.zip swift-13801557b6664426cac26384441ab0b19ff9abb5.tar.bz2 |
Listen to IPv6 any address instead of only IPv4
This should enable IPv4/IPv6 dual-stack support for Swift(-en)
Jingle file-transfer support.
Add Connection::getRemoteAddress() method.
Test-Information:
Tested IPv6 file-transfer and IPv4 file-transfer between two
Swift instances.
Added integration test verifying IPv4 only, IPv6 only and
IPv4/IPv6 dual-stack support on the running platform.
Additionally added test to verify remote addresses on dual-stack
server.
Change-Id: Ie384a71833eacca554f69e6f12a1c8330d0d747f
Diffstat (limited to 'Swiften/FileTransfer')
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp | 2 | ||||
-rw-r--r-- | Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp | 22 |
2 files changed, 16 insertions, 8 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp index f531856..7b97698 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp @@ -117,7 +117,7 @@ void SOCKS5BytestreamServerManager::initialize() { int port; for (port = LISTEN_PORTS_BEGIN; port < LISTEN_PORTS_END; ++port) { SWIFT_LOG(debug) << "Trying to start server on port " << port << std::endl; - connectionServer = connectionServerFactory->createConnectionServer(HostAddress("0.0.0.0"), port); + connectionServer = connectionServerFactory->createConnectionServer(HostAddress("::"), port); boost::optional<ConnectionServer::Error> error = connectionServer->tryStart(); if (!error) { break; diff --git a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp index 78ea8ed..a0f6033 100644 --- a/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp +++ b/Swiften/FileTransfer/UnitTest/SOCKS5BytestreamClientSessionTest.cpp @@ -4,11 +4,11 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ -#include <Swiften/Base/ByteArray.h> -#include <QA/Checker/IO.h> - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ #include <boost/bind.hpp> #include <boost/random/mersenne_twister.hpp> @@ -16,11 +16,18 @@ #include <boost/random/variate_generator.hpp> #include <boost/smart_ptr/make_shared.hpp> +#include <QA/Checker/IO.h> + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/extensions/TestFactoryRegistry.h> + #include <Swiften/Base/Algorithm.h> #include <Swiften/Base/ByteArray.h> #include <Swiften/Base/Concat.h> #include <Swiften/Base/Log.h> #include <Swiften/Base/StartStopper.h> +#include <Swiften/Crypto/CryptoProvider.h> +#include <Swiften/Crypto/PlatformCryptoProvider.h> #include <Swiften/EventLoop/DummyEventLoop.h> #include <Swiften/FileTransfer/ByteArrayReadBytestream.h> #include <Swiften/FileTransfer/ByteArrayWriteBytestream.h> @@ -30,8 +37,6 @@ #include <Swiften/Network/DummyConnection.h> #include <Swiften/Network/DummyTimerFactory.h> #include <Swiften/StringCodecs/Hexify.h> -#include <Swiften/Crypto/CryptoProvider.h> -#include <Swiften/Crypto/PlatformCryptoProvider.h> using namespace Swift; @@ -278,6 +283,9 @@ private: } HostAddressPort getLocalAddress() const { return HostAddressPort(); } + + HostAddressPort getRemoteAddress() const { return HostAddressPort(); } + void disconnect() { disconnectCalled = true; } |