summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-01 12:46:59 (GMT)
committerSwift Review <review@swift.im>2015-10-14 09:26:15 (GMT)
commit23b2e7e80034d6513995801c39f818a1181e3249 (patch)
tree223091009bee6473fd7eca52c81282d99fa1c4a3 /Swiften/FileTransfer
parent39f291afd3cab9d6c1e7cdf7f0f5476ef6747abd (diff)
downloadswift-23b2e7e80034d6513995801c39f818a1181e3249.zip
swift-23b2e7e80034d6513995801c39f818a1181e3249.tar.bz2
Remove remains of OutgoingSIFileTransfer
This existing code was commented out. There are not tests for it and no counterpart for incoming transfers. We support Jingle-based file-transfers as the main file-transfer method, as do lots of other clients. Test-Informations: Tested the complete project still builds. Change-Id: Icf278165733fe481b4e2bc777a73bc420cf76398
Diffstat (limited to 'Swiften/FileTransfer')
-rw-r--r--Swiften/FileTransfer/OutgoingSIFileTransfer.cpp87
-rw-r--r--Swiften/FileTransfer/OutgoingSIFileTransfer.h54
-rw-r--r--Swiften/FileTransfer/SConscript1
3 files changed, 0 insertions, 142 deletions
diff --git a/Swiften/FileTransfer/OutgoingSIFileTransfer.cpp b/Swiften/FileTransfer/OutgoingSIFileTransfer.cpp
deleted file mode 100644
index f100ed4..0000000
--- a/Swiften/FileTransfer/OutgoingSIFileTransfer.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * Copyright (c) 2010-2013 Isode Limited.
3 * All rights reserved.
4 * See the COPYING file for more information.
5 */
6
7#include <Swiften/FileTransfer/OutgoingSIFileTransfer.h>
8
9#include <boost/bind.hpp>
10#include <boost/smart_ptr/make_shared.hpp>
11
12#include <Swiften/FileTransfer/StreamInitiationRequest.h>
13#include <Swiften/FileTransfer/BytestreamsRequest.h>
14#include <Swiften/FileTransfer/SOCKS5BytestreamServer.h>
15#include <Swiften/FileTransfer/IBBSendSession.h>
16
17namespace Swift {
18
19OutgoingSIFileTransfer::OutgoingSIFileTransfer(const std::string& id, const JID& from, const JID& to, const std::string& name, unsigned long long size, const std::string& description, boost::shared_ptr<ReadBytestream> bytestream, IQRouter* iqRouter, SOCKS5BytestreamServer* socksServer) : id(id), from(from), to(to), name(name), size(size), description(description), bytestream(bytestream), iqRouter(iqRouter), socksServer(socksServer) {
20}
21
22void OutgoingSIFileTransfer::start() {
23 /*
24 StreamInitiation::ref streamInitiation(new StreamInitiation());
25 streamInitiation->setID(id);
26 streamInitiation->setFileInfo(StreamInitiationFileInfo(name, description, size));
27 //streamInitiation->addProvidedMethod("http://jabber.org/protocol/bytestreams");
28 streamInitiation->addProvidedMethod("http://jabber.org/protocol/ibb");
29 StreamInitiationRequest::ref request = StreamInitiationRequest::create(to, streamInitiation, iqRouter);
30 request->onResponse.connect(boost::bind(&OutgoingSIFileTransfer::handleStreamInitiationRequestResponse, this, _1, _2));
31 request->send();
32 */
33}
34
35void OutgoingSIFileTransfer::stop() {
36}
37
38void OutgoingSIFileTransfer::handleStreamInitiationRequestResponse(StreamInitiation::ref, ErrorPayload::ref) {
39 /*
40 if (error) {
41 finish(FileTransferError());
42 }
43 else {
44 if (response->getRequestedMethod() == "http://jabber.org/protocol/bytestreams") {
45 socksServer->addReadBytestream(id, from, to, bytestream);
46 Bytestreams::ref bytestreams(new Bytestreams());
47 bytestreams->setStreamID(id);
48 HostAddressPort addressPort = socksServer->getAddressPort();
49 bytestreams->addStreamHost(Bytestreams::StreamHost(addressPort.getAddress().toString(), from, addressPort.getPort()));
50 BytestreamsRequest::ref request = BytestreamsRequest::create(to, bytestreams, iqRouter);
51 request->onResponse.connect(boost::bind(&OutgoingSIFileTransfer::handleBytestreamsRequestResponse, this, _1, _2));
52 request->send();
53 }
54 else if (response->getRequestedMethod() == "http://jabber.org/protocol/ibb") {
55 ibbSession = boost::make_shared<IBBSendSession>(id, from, to, bytestream, iqRouter);
56 ibbSession->onFinished.connect(boost::bind(&OutgoingSIFileTransfer::handleIBBSessionFinished, this, _1));
57 ibbSession->start();
58 }
59 }
60 */
61}
62
63void OutgoingSIFileTransfer::handleBytestreamsRequestResponse(Bytestreams::ref, ErrorPayload::ref) {
64 /*
65 if (error) {
66 finish(FileTransferError());
67 }
68 */
69 //socksServer->onTransferFinished.connect();
70}
71
72void OutgoingSIFileTransfer::finish(boost::optional<FileTransferError>) {
73 /*
74 if (ibbSession) {
75 ibbSession->onFinished.disconnect(boost::bind(&OutgoingSIFileTransfer::handleIBBSessionFinished, this, _1));
76 ibbSession.reset();
77 }
78 socksServer->removeReadBytestream(id, from, to);
79 onFinished(error);
80 */
81}
82
83void OutgoingSIFileTransfer::handleIBBSessionFinished(boost::optional<FileTransferError>) {
84 //finish(error);
85}
86
87}
diff --git a/Swiften/FileTransfer/OutgoingSIFileTransfer.h b/Swiften/FileTransfer/OutgoingSIFileTransfer.h
deleted file mode 100644
index c323a77..0000000
--- a/Swiften/FileTransfer/OutgoingSIFileTransfer.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Copyright (c) 2010-2015 Isode Limited.
3 * All rights reserved.
4 * See the COPYING file for more information.
5 */
6
7#pragma once
8
9#include <boost/shared_ptr.hpp>
10
11#include <Swiften/Base/API.h>
12#include <Swiften/FileTransfer/OutgoingFileTransfer.h>
13#include <Swiften/FileTransfer/ReadBytestream.h>
14#include <Swiften/Base/boost_bsignals.h>
15#include <Swiften/FileTransfer/FileTransferError.h>
16#include <Swiften/FileTransfer/SOCKS5BytestreamServer.h>
17#include <Swiften/JID/JID.h>
18#include <Swiften/Elements/StreamInitiation.h>
19#include <Swiften/Elements/Bytestreams.h>
20#include <Swiften/Elements/ErrorPayload.h>
21#include <Swiften/FileTransfer/IBBSendSession.h>
22
23namespace Swift {
24 class IQRouter;
25 class SOCKS5BytestreamServer;
26
27 class SWIFTEN_API OutgoingSIFileTransfer : public OutgoingFileTransfer {
28 public:
29 OutgoingSIFileTransfer(const std::string& id, const JID& from, const JID& to, const std::string& name, unsigned long long size, const std::string& description, boost::shared_ptr<ReadBytestream> bytestream, IQRouter* iqRouter, SOCKS5BytestreamServer* socksServer);
30
31 virtual void start();
32 virtual void stop();
33
34 boost::signal<void (const boost::optional<FileTransferError>&)> onFinished;
35
36 private:
37 void handleStreamInitiationRequestResponse(StreamInitiation::ref, ErrorPayload::ref);
38 void handleBytestreamsRequestResponse(Bytestreams::ref, ErrorPayload::ref);
39 void finish(boost::optional<FileTransferError> error);
40 void handleIBBSessionFinished(boost::optional<FileTransferError> error);
41
42 private:
43 std::string id;
44 JID from;
45 JID to;
46 std::string name;
47 unsigned long long size;
48 std::string description;
49 boost::shared_ptr<ReadBytestream> bytestream;
50 IQRouter* iqRouter;
51 SOCKS5BytestreamServer* socksServer;
52 boost::shared_ptr<IBBSendSession> ibbSession;
53 };
54}
diff --git a/Swiften/FileTransfer/SConscript b/Swiften/FileTransfer/SConscript
index ff162ad..41af8d4 100644
--- a/Swiften/FileTransfer/SConscript
+++ b/Swiften/FileTransfer/SConscript
@@ -1,11 +1,10 @@
1Import("swiften_env", "env") 1Import("swiften_env", "env")
2 2
3sources = [ 3sources = [
4 "ByteArrayReadBytestream.cpp", 4 "ByteArrayReadBytestream.cpp",
5 "OutgoingFileTransfer.cpp", 5 "OutgoingFileTransfer.cpp",
6 "OutgoingSIFileTransfer.cpp",
7 "OutgoingJingleFileTransfer.cpp", 6 "OutgoingJingleFileTransfer.cpp",
8 "OutgoingFileTransferManager.cpp", 7 "OutgoingFileTransferManager.cpp",
9 "IncomingFileTransfer.cpp", 8 "IncomingFileTransfer.cpp",
10 "IncomingJingleFileTransfer.cpp", 9 "IncomingJingleFileTransfer.cpp",
11 "IncomingFileTransferManager.cpp", 10 "IncomingFileTransferManager.cpp",