summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2014-08-21 08:38:11 (GMT)
committerKevin Smith <git@kismith.co.uk>2014-08-21 08:40:10 (GMT)
commit381b22fc365c27b9cd585f4b78f53ebc698d9f54 (patch)
tree0ffd89a8be13293c75c7ddfea524c74e0bf87b72 /Swiften/Parser
parent8ec22a9c5591584fd1725ed028d714c51b7509d3 (diff)
downloadswift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.zip
swift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.tar.bz2
Clean up compilation errors in Swiften due to boost 1.56
Can no longer implicitly convert boost::optional to bool temporaries. Also fixed assorted uses of cerr where logging was appropriate. Test-Information: Swiften compiles against boost 1.56 (link fails for me so far) Change-Id: Iec058af933a82a987da64291435a475f8b40ef96
Diffstat (limited to 'Swiften/Parser')
-rw-r--r--Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp b/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp
index 14a80e6..7be4c26 100644
--- a/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp
+++ b/Swiften/Parser/PayloadParsers/JingleS5BTransportMethodPayloadParser.cpp
@@ -1,15 +1,21 @@
/*
* Copyright (c) 2011 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+* Copyright (c) 2014 Kevin Smith
+* Licensed under the GNU General Public License v3.
+* See Documentation/Licenses/GPLv3.txt for more information.
+*/
+
#include <boost/lexical_cast.hpp>
#include <boost/optional.hpp>
#include "JingleS5BTransportMethodPayloadParser.h"
#include <Swiften/Base/Log.h>
namespace Swift {
JingleS5BTransportMethodPayloadParser::JingleS5BTransportMethodPayloadParser() : level(0) {
@@ -19,19 +25,19 @@ namespace Swift {
void JingleS5BTransportMethodPayloadParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) {
if (level == 0) {
getPayloadInternal()->setSessionID(attributes.getAttributeValue("sid").get_value_or(""));
std::string mode = attributes.getAttributeValue("mode").get_value_or("tcp");
if (mode == "tcp") {
getPayloadInternal()->setMode(JingleS5BTransportPayload::TCPMode);
} else if(mode == "udp") {
getPayloadInternal()->setMode(JingleS5BTransportPayload::UDPMode);
} else {
- std::cerr << "Unknown S5B mode; falling back to defaul!" << std::endl;
+ SWIFT_LOG(warning) << "Unknown S5B mode; falling back to defaul!";
getPayloadInternal()->setMode(JingleS5BTransportPayload::TCPMode);
}
} else if (level == 1) {
if (element == "candidate") {
JingleS5BTransportPayload::Candidate candidate;
candidate.cid = attributes.getAttributeValue("cid").get_value_or("");
int port = -1;
try {
@@ -75,14 +81,14 @@ namespace Swift {
if (str == "direct") {
return JingleS5BTransportPayload::Candidate::DirectType;
} else if (str == "assisted") {
return JingleS5BTransportPayload::Candidate::AssistedType;
} else if (str == "tunnel") {
return JingleS5BTransportPayload::Candidate::TunnelType;
} else if (str == "proxy") {
return JingleS5BTransportPayload::Candidate::ProxyType;
} else {
- std::cerr << "Unknown candidate type; falling back to default!" << std::endl;
+ SWIFT_LOG(warning) << "Unknown candidate type; falling back to default!";
return JingleS5BTransportPayload::Candidate::DirectType;
}
}
}