diff options
author | Tobias Markmann <tm@ayena.de> | 2015-01-09 16:39:11 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2015-02-11 09:35:21 (GMT) |
commit | 779f0d57bc9d90300aad0b1386dc937612ac35f4 (patch) | |
tree | 2b7beb4db6af92eef45a6adaf0118d3ba149056b /Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp | |
parent | 66567c962202920b0d6bc06029ed37565cd4a81c (diff) | |
download | swift-779f0d57bc9d90300aad0b1386dc937612ac35f4.zip swift-779f0d57bc9d90300aad0b1386dc937612ac35f4.tar.bz2 |
Support domain names in S5B proxy <streamhost> tags.
S5BProxyManager now resolves DNS names of proxy entries discovered via
service discovery.
Test-Information:
Tested against a XMPP installation that uses domain names in proxy entires.
Change-Id: I728243333ec6e62e86f088f2a7b6e222c629757b
Diffstat (limited to 'Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp')
-rw-r--r-- | Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp index 207f590..aaf90ea 100644 --- a/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp +++ b/Swiften/FileTransfer/UnitTest/IncomingJingleFileTransferTest.cpp @@ -2,13 +2,13 @@ * Copyright (c) 2011 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* - * Copyright (c) 2013-2014 Isode Limited. + * Copyright (c) 2013-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> @@ -25,12 +25,13 @@ #include <Swiften/Elements/JingleFileTransferDescription.h> #include <Swiften/FileTransfer/DefaultFileTransferTransporterFactory.h> #include <Swiften/FileTransfer/ByteArrayWriteBytestream.h> #include <Swiften/FileTransfer/IncomingJingleFileTransfer.h> #include <Swiften/FileTransfer/SOCKS5BytestreamRegistry.h> #include <Swiften/Network/PlatformNetworkEnvironment.h> +#include <Swiften/Network/StaticDomainNameResolver.h> #include <Swiften/FileTransfer/SOCKS5BytestreamProxiesManager.h> #include <Swiften/FileTransfer/SOCKS5BytestreamServerManager.h> #include <Swiften/Jingle/FakeJingleSession.h> #include <Swiften/Network/NATTraverser.h> #include <Swiften/Network/DummyTimerFactory.h> #include <Swiften/EventLoop/DummyEventLoop.h> @@ -64,12 +65,13 @@ public: return request; } void setUp() { crypto = boost::shared_ptr<CryptoProvider>(PlatformCryptoProvider::create()); eventLoop = new DummyEventLoop(); + resolver = new StaticDomainNameResolver(eventLoop); session = boost::make_shared<FakeJingleSession>("foo@bar.com/baz", "mysession"); jingleContentPayload = make_shared<JingleContentPayload>(); // fakeRJTCSF = make_shared<FakeRemoteJingleTransportCandidateSelectorFactory>(); // fakeLJTCF = make_shared<FakeLocalJingleTransportCandidateGeneratorFactory>(); stanzaChannel = new DummyStanzaChannel(); connectionFactory = new DummyConnectionFactory(eventLoop); @@ -78,25 +80,26 @@ public: bytestreamRegistry = new SOCKS5BytestreamRegistry(); networkEnvironment = new PlatformNetworkEnvironment(); natTraverser = new PlatformNATTraversalWorker(eventLoop); bytestreamServerManager = new SOCKS5BytestreamServerManager(bytestreamRegistry, serverConnectionFactory, networkEnvironment, natTraverser); idGenerator = new SimpleIDGenerator(); timerFactory = new DummyTimerFactory(); - bytestreamProxy = new SOCKS5BytestreamProxiesManager(connectionFactory, timerFactory); + bytestreamProxy = new SOCKS5BytestreamProxiesManager(connectionFactory, timerFactory, resolver, iqRouter, "bar.com"); ftTransporterFactory = new DefaultFileTransferTransporterFactory(bytestreamRegistry, bytestreamServerManager, bytestreamProxy, idGenerator, connectionFactory, timerFactory, crypto.get(), iqRouter); } void tearDown() { delete ftTransporterFactory; delete bytestreamServerManager; delete bytestreamProxy; delete connectionFactory; delete timerFactory; delete bytestreamRegistry; delete iqRouter; delete stanzaChannel; + delete resolver; delete eventLoop; Log::setLogLevel(Log::error); } // Tests whether IncomingJingleFileTransfer would accept a IBB only file transfer. void test_AcceptOnyIBBSendsSessionAccept() { @@ -229,9 +232,10 @@ private: DummyConnectionServerFactory* serverConnectionFactory; SOCKS5BytestreamProxiesManager* bytestreamProxy; DummyTimerFactory* timerFactory; NetworkEnvironment* networkEnvironment; NATTraverser* natTraverser; IDGenerator* idGenerator; + DomainNameResolver* resolver; }; CPPUNIT_TEST_SUITE_REGISTRATION(IncomingJingleFileTransferTest); |