summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-03-08 15:36:49 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-05-01 17:14:55 (GMT)
commit794fec2873e69ec047974416768b32b69754dad1 (patch)
treea3cc8cb221e9ee7ad5c40a9de0ccc03e5f9d9562 /Swiften/FileTransfer/SOCKS5BytestreamServerInitializeRequest.cpp
parentd7bc3a37f4bb261c8520a8ddedcda2369f97361c (diff)
downloadswift-794fec2873e69ec047974416768b32b69754dad1.zip
swift-794fec2873e69ec047974416768b32b69754dad1.tar.bz2
Add resource management for S5B server and port forwardings
This patchs adds management of the SOCKS5 bytestream server and port forwarding setup to Swiften. The first file-transfer, regardless of incoming or outgoing transfer, will start and initialize the S5B server and if configured try to set up port forwarding. The last file-transfer to finish will will close the server and remove the port forwarding. Test-Information: Tested with upcoming ConcurrentFileTransferTest.cpp and running multiple S5B file-transfers in parallel. Change-Id: Idd09d3d0ef9498fc9435b0aee81f2b1061783342
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamServerInitializeRequest.cpp')
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerInitializeRequest.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerInitializeRequest.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerInitializeRequest.cpp
deleted file mode 100644
index c32d142..0000000
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerInitializeRequest.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2012 Isode Limited.
- * All rights reserved.
- * See the COPYING file for more information.
- */
-
-#include <Swiften/FileTransfer/SOCKS5BytestreamServerInitializeRequest.h>
-
-#include <boost/bind.hpp>
-
-#include <Swiften/FileTransfer/SOCKS5BytestreamServerManager.h>
-
-using namespace Swift;
-
-SOCKS5BytestreamServerInitializeRequest::SOCKS5BytestreamServerInitializeRequest(SOCKS5BytestreamServerManager* manager) : manager(manager) {
-}
-
-SOCKS5BytestreamServerInitializeRequest::~SOCKS5BytestreamServerInitializeRequest() {
-}
-
-void SOCKS5BytestreamServerInitializeRequest::start() {
- if (manager->isInitialized()) {
- handleInitialized(true);
- }
- else {
- manager->onInitialized.connect(
- boost::bind(&SOCKS5BytestreamServerInitializeRequest::handleInitialized, this, _1));
- manager->initialize();
- }
-}
-
-void SOCKS5BytestreamServerInitializeRequest::stop() {
- manager->onInitialized.disconnect(
- boost::bind(&SOCKS5BytestreamServerInitializeRequest::handleInitialized, this, _1));
-}
-
-void SOCKS5BytestreamServerInitializeRequest::handleInitialized(bool success) {
- onFinished(success);
-}