summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-03 11:09:08 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-03 11:09:08 (GMT)
commit10334c139670861d4860da59ad837fc3fe6fd41e (patch)
treeb632360747e635e229f336760ccc76789797a8bf /Swiften/Client/ClientXMLTracer.cpp
parent8189054fca9c68194ffc328eb7beecf241bbbcd7 (diff)
downloadswift-10334c139670861d4860da59ad837fc3fe6fd41e.zip
swift-10334c139670861d4860da59ad837fc3fe6fd41e.tar.bz2
Ensure safety on onDataRead and onDataWritten signals.
Diffstat (limited to 'Swiften/Client/ClientXMLTracer.cpp')
-rw-r--r--Swiften/Client/ClientXMLTracer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Swiften/Client/ClientXMLTracer.cpp b/Swiften/Client/ClientXMLTracer.cpp
index a26ce66..441da9b 100644
--- a/Swiften/Client/ClientXMLTracer.cpp
+++ b/Swiften/Client/ClientXMLTracer.cpp
@@ -9,6 +9,8 @@
#include <iostream>
#include <boost/bind.hpp>
+#include <Swiften/Base/SafeString.h>
+
namespace Swift {
ClientXMLTracer::ClientXMLTracer(CoreClient* client) {
@@ -16,9 +18,9 @@ ClientXMLTracer::ClientXMLTracer(CoreClient* client) {
client->onDataWritten.connect(boost::bind(&ClientXMLTracer::printData, '>', _1));
}
-void ClientXMLTracer::printData(char direction, const std::string& data) {
+void ClientXMLTracer::printData(char direction, const SafeByteArray& data) {
printLine(direction);
- std::cerr << data << std::endl;
+ std::cerr << byteArrayToString(ByteArray(data.begin(), data.end())) << std::endl;
}
void ClientXMLTracer::printLine(char c) {