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/Serializer/PayloadSerializers
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/Serializer/PayloadSerializers')
-rw-r--r--Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp9
-rw-r--r--Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp2
2 files changed, 11 insertions, 0 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
index c753839..220d8dd 100644
--- a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.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 <Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.h>
#include <boost/shared_ptr.hpp>
@@ -25,6 +31,9 @@ std::string JingleS5BTransportPayloadSerializer::serializePayload(boost::shared_
XMLElement payloadXML("transport", "urn:xmpp:jingle:transports:s5b:1");
payloadXML.setAttribute("sid", payload->getSessionID());
payloadXML.setAttribute("mode", modeToString(payload->getMode()));
+ if (!payload->getDstAddr().empty()) {
+ payloadXML.setAttribute("dstaddr", payload->getDstAddr());
+ }
foreach(JingleS5BTransportPayload::Candidate candidate, payload->getCandidates()) {
boost::shared_ptr<XMLElement> candidateXML = boost::make_shared<XMLElement>("candidate");
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
index 722c039..8d5bcb7 100644
--- a/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
+++ b/Swiften/Serializer/PayloadSerializers/UnitTest/JingleSerializersTest.cpp
@@ -377,6 +377,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
" xmlns=\"urn:xmpp:jingle:1\">"
"<content creator=\"initiator\" name=\"ex\">"
"<transport"
+ " dstaddr=\"1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba\""
" mode=\"tcp\""
" sid=\"vj3hs98y\""
" xmlns=\"urn:xmpp:jingle:transports:s5b:1\">"
@@ -407,6 +408,7 @@ class JingleSerializersTest : public CppUnit::TestFixture {
JingleS5BTransportPayload::ref transport = boost::make_shared<JingleS5BTransportPayload>();
transport->setMode(JingleS5BTransportPayload::TCPMode);
+ transport->setDstAddr("1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba");
transport->setSessionID("vj3hs98y");
JingleS5BTransportPayload::Candidate candidate1;