summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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;
};