summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-01-11 17:13:41 (GMT)
committerSwift Review <review@swift.im>2015-02-11 09:36:14 (GMT)
commita049c80f0862a994a76e8e63d71c633bce63f66a (patch)
treec5fc7786d2d245c765067545bb9a0e433e58a3f9 /Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
parentf176050a50fb846bbad3fb49d6b2f7a2c81e3589 (diff)
downloadswift-a049c80f0862a994a76e8e63d71c633bce63f66a.zip
swift-a049c80f0862a994a76e8e63d71c633bce63f66a.tar.bz2
Renable SOCKS5 bytestream proxy support for Jingle file transfers.
Test-Information: Tested interoperability with Swiften using FileTransferTest. Change-Id: Ic13a68a91cad199be0bfc8852ff43c25c7085f12
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp')
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
index 82fd17e..812adbe 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamClientSession.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -36,7 +36,7 @@ SOCKS5BytestreamClientSession::SOCKS5BytestreamClientSession(
destination(destination),
state(Initial),
chunkSize(131072) {
- weFailedTimeout = timerFactory->createTimer(2000);
+ weFailedTimeout = timerFactory->createTimer(3000);
weFailedTimeout->onTick.connect(
boost::bind(&SOCKS5BytestreamClientSession::handleWeFailedTimeout, this));
}
@@ -55,6 +55,9 @@ void SOCKS5BytestreamClientSession::start() {
void SOCKS5BytestreamClientSession::stop() {
SWIFT_LOG(debug) << std::endl;
+ if (state < Ready) {
+ weFailedTimeout->stop();
+ }
if (state == Finished) {
return;
}
@@ -201,7 +204,9 @@ void SOCKS5BytestreamClientSession::sendData() {
void SOCKS5BytestreamClientSession::finish(bool error) {
SWIFT_LOG(debug) << std::endl;
- weFailedTimeout->stop();
+ if (state < Ready) {
+ weFailedTimeout->stop();
+ }
closeConnection();
readBytestream.reset();
if (state == Initial || state == Hello || state == Authenticating) {
@@ -228,6 +233,7 @@ void SOCKS5BytestreamClientSession::handleConnectFinished(bool error) {
boost::bind(&SOCKS5BytestreamClientSession::handleDisconnected, this, _1));
dataReadConnection = connection->onDataRead.connect(
boost::bind(&SOCKS5BytestreamClientSession::handleDataRead, this, _1));
+ weFailedTimeout->stop();
weFailedTimeout->start();
process();
}