summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-09-30 18:46:42 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-09-30 18:46:42 (GMT)
commit1b255f6ba90847240b92126deb5ea0174ad269b0 (patch)
tree9d56e647ebc35c0f0941d19a302b888c1185ce1c /Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
parentaf976a75b5e1b504a340602659ef930109cd2c48 (diff)
downloadswift-contrib-1b255f6ba90847240b92126deb5ea0174ad269b0.zip
swift-contrib-1b255f6ba90847240b92126deb5ea0174ad269b0.tar.bz2
Avoid a copy when reading from a byte array.
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp')
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
index db3d83f..cd555e5 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
@@ -165,9 +165,9 @@ HostAddressPort SOCKS5BytestreamClientSession::getAddressPort() const {
void SOCKS5BytestreamClientSession::sendData() {
if (!readBytestream->isFinished()) {
try {
- SafeByteArray dataToSend = createSafeByteArray(readBytestream->read(chunkSize));
- connection->write(dataToSend);
- onBytesSent(dataToSend.size());
+ boost::shared_ptr<ByteArray> dataToSend = readBytestream->read(chunkSize);
+ connection->write(createSafeByteArray(*dataToSend));
+ onBytesSent(dataToSend->size());
}
catch (const BytestreamException&) {
finish(true);