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/IncomingJingleFileTransfer.h
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/IncomingJingleFileTransfer.h')
-rw-r--r--Swiften/FileTransfer/IncomingJingleFileTransfer.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.h b/Swiften/FileTransfer/IncomingJingleFileTransfer.h
index 727d278..7fc22f4 100644
--- a/Swiften/FileTransfer/IncomingJingleFileTransfer.h
+++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.h
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2014 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
@@ -14,25 +14,34 @@
#include <Swiften/Base/Override.h>
#include <Swiften/Jingle/JingleContentID.h>
#include <Swiften/FileTransfer/IncomingFileTransfer.h>
#include <Swiften/FileTransfer/JingleFileTransfer.h>
#include <Swiften/Elements/JingleS5BTransportPayload.h>
#include <Swiften/FileTransfer/FileTransferOptions.h>
+#include <Swiften/Base/ByteArray.h>
namespace Swift {
class JID;
class JingleSession;
class JingleContentPayload;
class FileTransferTransporter;
class FileTransferTransporterFactory;
class TimerFactory;
class Timer;
class CryptoProvider;
class IncrementalBytestreamHashCalculator;
class JingleFileTransferDescription;
+ class HashElement;
+ /**
+ * @brief The IncomingJingleFileTransfer class contains the business logic for managing incoming
+ * Jingle file transfers.
+ *
+ * Calling IncomingJingleFileTransfer::accept will start to negotiate possible transfer
+ * methods and after a working method has been decided among peers the trasnfer is started.
+ */
class SWIFTEN_API IncomingJingleFileTransfer : public IncomingFileTransfer, public JingleFileTransfer {
public:
typedef boost::shared_ptr<IncomingJingleFileTransfer> ref;
IncomingJingleFileTransfer(
const JID& recipient,
@@ -40,13 +49,13 @@ namespace Swift {
boost::shared_ptr<JingleContentPayload> content,
FileTransferTransporterFactory*,
TimerFactory*,
CryptoProvider*);
~IncomingJingleFileTransfer();
- virtual void accept(boost::shared_ptr<WriteBytestream>, const FileTransferOptions&) SWIFTEN_OVERRIDE;
+ virtual void accept(boost::shared_ptr<WriteBytestream>, const FileTransferOptions& = FileTransferOptions()) SWIFTEN_OVERRIDE;
virtual void cancel() SWIFTEN_OVERRIDE;
private:
enum State {
Initial,
GeneratingInitialLocalCandidates,
@@ -105,14 +114,13 @@ namespace Swift {
State state;
boost::shared_ptr<JingleFileTransferDescription> description;
boost::shared_ptr<WriteBytestream> stream;
boost::uintmax_t receivedBytes;
IncrementalBytestreamHashCalculator* hashCalculator;
boost::shared_ptr<Timer> waitOnHashTimer;
- std::string hashAlgorithm;
- std::string hash;
+ std::map<std::string, ByteArray> hashes;
FileTransferOptions options;
boost::bsignals::scoped_connection writeStreamDataReceivedConnection;
boost::bsignals::scoped_connection waitOnHashTimerTickedConnection;
boost::bsignals::connection transferFinishedConnection;
};