summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-01-08 15:36:30 (GMT)
committerSwift Review <review@swift.im>2015-02-03 11:45:21 (GMT)
commitc09a8453114e7525d7f2efd220ee94f13716d73e (patch)
tree34a89163bae62114db5786e0aee65f2f1df293e3 /Swiften/Parser/PayloadParsers
parent6cdd1ba4513bec0e192b5735d5476ed9f0bb8c3f (diff)
downloadswift-c09a8453114e7525d7f2efd220ee94f13716d73e.zip
swift-c09a8453114e7525d7f2efd220ee94f13716d73e.tar.bz2
Added support for dstaddr attribute for SOCKS5 bytestream jingle
transport method element, parser and serializer. Test-Information: Adjusted parser and serializer tests to cover this feature. Change-Id: I660ef8d292a0fe09f80c042bc6df417b0e7525b1
Diffstat (limited to 'Swiften/Parser/PayloadParsers')
-rw-r--r--Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp3
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp8
2 files changed, 10 insertions, 1 deletions
diff --git a/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp b/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp
index d7b5bb0..dc05352 100644
--- a/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp
@@ -5,7 +5,7 @@
*/
/*
-* Copyright (c) 2014 Isode Limited.
+* Copyright (c) 2014-2015 Isode Limited.
* All rights reserved.v3.
* See the COPYING file for more information.
*/
@@ -34,6 +34,7 @@ namespace Swift {
SWIFT_LOG(warning) << "Unknown S5B mode; falling back to defaul!";
getPayloadInternal()->setMode(JingleS5BTransportPayload::TCPMode);
}
+ getPayloadInternal()->setDstAddr(attributes.getAttributeValue("dstaddr").get_value_or(""));
} else if (level == 1) {
if (element == "candidate") {
JingleS5BTransportPayload::Candidate candidate;
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp
index a6be599..9c166b2 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/JingleParserTest.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
@@ -540,6 +546,7 @@ class JingleParserTest : public CppUnit::TestFixture {
" <content creator='initiator' name='ex'>\n"
" <description xmlns='urn:xmpp:example'/>\n"
" <transport xmlns='urn:xmpp:jingle:transports:s5b:1'\n"
+ " dstaddr='1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba'\n"
" mode='tcp'\n"
" sid='vj3hs98y'>\n"
" <candidate cid='ht567dq'\n"
@@ -579,6 +586,7 @@ class JingleParserTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(std::string("vj3hs98y"), s5bPayload->getSessionID());
CPPUNIT_ASSERT_EQUAL(JingleS5BTransportPayload::TCPMode, s5bPayload->getMode());
+ CPPUNIT_ASSERT_EQUAL(std::string("1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba"), s5bPayload->getDstAddr());
CPPUNIT_ASSERT_EQUAL(false, s5bPayload->hasCandidateError());
CPPUNIT_ASSERT_EQUAL(false, s5bPayload->hasProxyError());
CPPUNIT_ASSERT_EQUAL(std::string(), s5bPayload->getActivated());