summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-12-17 15:21:30 (GMT)
committerSwift Review <review@swift.im>2015-02-03 10:03:17 (GMT)
commitb5fc240f1cf4e340e04177a23cb8cf827b9ca16b (patch)
tree13d701e160af328553551974e55fea876d21eed8 /Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
parentd860805af76ec85e003bf3019407bbb7acd218c9 (diff)
downloadswift-b5fc240f1cf4e340e04177a23cb8cf827b9ca16b.zip
swift-b5fc240f1cf4e340e04177a23cb8cf827b9ca16b.tar.bz2
Update Jingle FT protocol to namespace verison urn:xmpp:jingle:apps:file-transfer:4.
Test-Information: Adjusted unit tests and successfully build/run them on OS X 10.9.5. Change-Id: I63789e3fb351999f719157b54fa9fcf95f40fb07
Diffstat (limited to 'Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp')
-rw-r--r--Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
index 93214eb..369af8f 100644
--- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
@@ -2,13 +2,13 @@
* Copyright (c) 2011 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
/*
- * Copyright (C) 2013 Isode Limited.
+ * Copyright (C) 2013-2014 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
// TODO:
// - We should handle incoming terminates after we have terminated, so the other
@@ -46,13 +46,13 @@ static const int DEFAULT_BLOCK_SIZE = 4096;
OutgoingJingleFileTransfer::OutgoingJingleFileTransfer(
const JID& toJID,
JingleSession::ref session,
boost::shared_ptr<ReadBytestream> stream,
FileTransferTransporterFactory* transporterFactory,
IDGenerator* idGenerator,
- const StreamInitiationFileInfo& fileInfo,
+ const JingleFileTransferFileInfo& fileInfo,
const FileTransferOptions& options,
CryptoProvider* crypto) :
JingleFileTransfer(session, toJID, transporterFactory),
idGenerator(idGenerator),
stream(stream),
fileInfo(fileInfo),
@@ -146,26 +146,28 @@ void OutgoingJingleFileTransfer::handleTransportAcceptReceived(const JingleConte
}
void OutgoingJingleFileTransfer::sendSessionInfoHash() {
SWIFT_LOG(debug) << std::endl;
JingleFileTransferHash::ref hashElement = boost::make_shared<JingleFileTransferHash>();
- hashElement->setHash("sha-1", hashCalculator->getSHA1String());
- hashElement->setHash("md5", hashCalculator->getMD5String());
+ hashElement->getFileInfo().addHash(HashElement("sha-1", hashCalculator->getSHA1Hash()));
+ hashElement->getFileInfo().addHash(HashElement("md5", hashCalculator->getMD5Hash()));
session->sendInfo(hashElement);
}
void OutgoingJingleFileTransfer::handleLocalTransportCandidatesGenerated(
const std::string& s5bSessionID, const std::vector<JingleS5BTransportPayload::Candidate>& candidates) {
SWIFT_LOG(debug) << std::endl;
if (state != GeneratingInitialLocalCandidates) { SWIFT_LOG(warning) << "Incorrect state" << std::endl; return; }
fillCandidateMap(localCandidates, candidates);
JingleFileTransferDescription::ref description = boost::make_shared<JingleFileTransferDescription>();
- description->addOffer(fileInfo);
+ fileInfo.addHash(HashElement("sha-1", ByteArray()));
+ fileInfo.addHash(HashElement("md5", ByteArray()));
+ description->setFileInfo(fileInfo);
JingleS5BTransportPayload::ref transport = boost::make_shared<JingleS5BTransportPayload>();
transport->setSessionID(s5bSessionID);
transport->setMode(JingleS5BTransportPayload::TCPMode);
foreach(JingleS5BTransportPayload::Candidate candidate, candidates) {
transport->addCandidate(candidate);