diff options
author | Kevin Smith <git@kismith.co.uk> | 2014-08-21 08:38:11 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2014-08-21 08:40:10 (GMT) |
commit | 381b22fc365c27b9cd585f4b78f53ebc698d9f54 (patch) | |
tree | 0ffd89a8be13293c75c7ddfea524c74e0bf87b72 /Swiften/FileTransfer | |
parent | 8ec22a9c5591584fd1725ed028d714c51b7509d3 (diff) | |
download | swift-381b22fc365c27b9cd585f4b78f53ebc698d9f54.zip swift-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/FileTransfer')
-rw-r--r-- | Swiften/FileTransfer/IBBReceiveSession.cpp | 16 | ||||
-rw-r--r-- | Swiften/FileTransfer/IncomingFileTransferManager.cpp | 5 | ||||
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp | 2 |
3 files changed, 12 insertions, 11 deletions
diff --git a/Swiften/FileTransfer/IBBReceiveSession.cpp b/Swiften/FileTransfer/IBBReceiveSession.cpp index 3aa6fdc..8cfd95d 100644 --- a/Swiften/FileTransfer/IBBReceiveSession.cpp +++ b/Swiften/FileTransfer/IBBReceiveSession.cpp @@ -33,29 +33,29 @@ class IBBReceiveSession::IBBResponder : public SetResponder<IBB> { sendResponse(from, id, IBB::ref()); if (receivedSize >= session->size) { if (receivedSize > session->size) { - std::cerr << "Warning: Received more data than expected" << std::endl; + SWIFT_LOG(warning) << "Received more data than expected"; } session->finish(boost::optional<FileTransferError>()); } } else { - SWIFT_LOG(warning) << "Received data out of order" << std::endl; + SWIFT_LOG(warning) << "Received data out of order"; sendError(from, id, ErrorPayload::NotAcceptable, ErrorPayload::Cancel); session->finish(FileTransferError(FileTransferError::ClosedError)); } } else if (ibb->getAction() == IBB::Open) { - SWIFT_LOG(debug) << "IBB open received" << std::endl; + SWIFT_LOG(debug) << "IBB open received"; sendResponse(from, id, IBB::ref()); } else if (ibb->getAction() == IBB::Close) { - SWIFT_LOG(debug) << "IBB close received" << std::endl; + SWIFT_LOG(debug) << "IBB close received"; sendResponse(from, id, IBB::ref()); session->finish(FileTransferError(FileTransferError::ClosedError)); } return true; } - SWIFT_LOG(debug) << "wrong from/sessionID: " << from << " == " << session->from << " / " <<ibb->getStreamID() << " == " << session->id << std::endl; + SWIFT_LOG(debug) << "wrong from/sessionID: " << from << " == " << session->from << " / " <<ibb->getStreamID() << " == " << session->id; return false; } @@ -87,19 +87,19 @@ IBBReceiveSession::IBBReceiveSession( IBBReceiveSession::~IBBReceiveSession() { if (active) { - SWIFT_LOG(warning) << "Session still active" << std::endl; + SWIFT_LOG(warning) << "Session still active"; } delete responder; } void IBBReceiveSession::start() { - SWIFT_LOG(debug) << "receive session started" << std::endl; + SWIFT_LOG(debug) << "receive session started"; active = true; responder->start(); } void IBBReceiveSession::stop() { - SWIFT_LOG(debug) << "receive session stopped" << std::endl; + SWIFT_LOG(debug) << "receive session stopped"; responder->stop(); if (active) { if (router->isAvailable()) { diff --git a/Swiften/FileTransfer/IncomingFileTransferManager.cpp b/Swiften/FileTransfer/IncomingFileTransferManager.cpp index d40c5de..d8c4f89 100644 --- a/Swiften/FileTransfer/IncomingFileTransferManager.cpp +++ b/Swiften/FileTransfer/IncomingFileTransferManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -8,6 +8,7 @@ #include <boost/smart_ptr/make_shared.hpp> +#include <Swiften/Base/Log.h> #include <Swiften/Elements/JingleDescription.h> #include <Swiften/Elements/JingleFileTransferDescription.h> #include <Swiften/Elements/JingleIBBTransportPayload.h> @@ -49,7 +50,7 @@ bool IncomingFileTransferManager::handleIncomingJingleSession( onIncomingFileTransfer(transfer); } else { - std::cerr << "Received a file-transfer request with no description or more than one file!" << std::endl; + SWIFT_LOG(warning) << "Received a file-transfer request with no description or more than one file."; session->sendTerminate(JinglePayload::Reason::FailedApplication); } } diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp index f393c8d..cb34c58 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp @@ -94,7 +94,7 @@ void SOCKS5BytestreamServerSession::handleDataAvailable() { void SOCKS5BytestreamServerSession::handleDisconnected(const boost::optional<Connection::Error>& error) { SWIFT_LOG(debug) << (error ? (error == Connection::ReadError ? "Read Error" : "Write Error") : "No Error") << std::endl; - finish(error); + finish(error ? true : false); } void SOCKS5BytestreamServerSession::process() { |