diff options
-rw-r--r-- | Swiften/FileTransfer/FileTransferManagerImpl.cpp | 5 | ||||
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp | 5 | ||||
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/Swiften/FileTransfer/FileTransferManagerImpl.cpp b/Swiften/FileTransfer/FileTransferManagerImpl.cpp index a30aeed..4eacf33 100644 --- a/Swiften/FileTransfer/FileTransferManagerImpl.cpp +++ b/Swiften/FileTransfer/FileTransferManagerImpl.cpp @@ -7,6 +7,7 @@ #include <Swiften/FileTransfer/FileTransferManagerImpl.h> #include <boost/bind.hpp> +#include <boost/cstdint.hpp> #include <Swiften/Base/foreach.h> #include "Swiften/Disco/EntityCapsProvider.h" @@ -94,12 +95,12 @@ boost::optional<JID> FileTransferManagerImpl::highestPriorityJIDSupportingFileTr OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer(const JID& to, const boost::filesystem::path& filepath, const std::string& description, boost::shared_ptr<ReadBytestream> bytestream) { std::string filename = filepath.filename(); - uintmax_t sizeInBytes = boost::filesystem::file_size(filepath); + boost::uintmax_t sizeInBytes = boost::filesystem::file_size(filepath); boost::posix_time::ptime lastModified = boost::posix_time::from_time_t(boost::filesystem::last_write_time(filepath)); return createOutgoingFileTransfer(to, filename, description, sizeInBytes, lastModified, bytestream); } -OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer(const JID& to, const std::string& filename, const std::string& description, const uintmax_t sizeInBytes, const boost::posix_time::ptime& lastModified, boost::shared_ptr<ReadBytestream> bytestream) { +OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer(const JID& to, const std::string& filename, const std::string& description, const boost::uintmax_t sizeInBytes, const boost::posix_time::ptime& lastModified, boost::shared_ptr<ReadBytestream> bytestream) { StreamInitiationFileInfo fileInfo; fileInfo.setDate(lastModified); fileInfo.setSize(sizeInBytes); diff --git a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp index f90b73b..a18b998 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp @@ -16,6 +16,7 @@ #include <Swiften/StringCodecs/Hexify.h> #include <Swiften/FileTransfer/BytestreamException.h> #include <Swiften/Network/TimerFactory.h> +#include <Swiften/Base/ByteArray.h> namespace Swift { @@ -89,7 +90,7 @@ void SOCKS5BytestreamClientSession::process() { // complete domainname and port not available yet break; } - bndAddress = createByteArray(&(unprocessedData.data()[5]), unprocessedData[4]); + bndAddress = createByteArray(&vecptr(unprocessedData)[5], unprocessedData[4]); if (unprocessedData[unprocessedData[4] + 5] != 0 && bndAddress == createByteArray(destination)) { // we expect a 0 as port // disconnect and fail @@ -215,7 +216,7 @@ void SOCKS5BytestreamClientSession::handleDataRead(const SafeByteArray& data) { process(); } else { - writeBytestream->write(createByteArray(data.data(), data.size())); + writeBytestream->write(createByteArray(vecptr(data), data.size())); onBytesReceived(data.size()); } } diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp index 6f33862..fa7e054 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.cpp @@ -70,7 +70,7 @@ void SOCKS5BytestreamServerSession::handleDataRead(const SafeByteArray& data) { append(unprocessedData, data); process(); } else { - writeBytestream->write(createByteArray(data.data(), data.size())); + writeBytestream->write(createByteArray(vecptr(data), data.size())); onBytesReceived(data.size()); } } |