diff options
author | Tobias Markmann <tm@ayena.de> | 2015-05-20 16:01:06 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2015-05-26 15:43:35 (GMT) |
commit | e544a3ad5a8d3cdf67554384f53895fad34ff9bc (patch) | |
tree | 2807a0a190fd9592f9aedb689af3462bc507f156 /Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp | |
parent | 009e94c604e2d892ea8711ed6b3756da3eea9d04 (diff) | |
download | swift-e544a3ad5a8d3cdf67554384f53895fad34ff9bc.zip swift-e544a3ad5a8d3cdf67554384f53895fad34ff9bc.tar.bz2 |
Fix crash when sending a file to yourself
Use scoped_connection to prevent missing disconnection from signals.
Stop and free S5BServer when stopping SOCKS5BytestreamServerManager.
Test-Information:
Tried sending a file to myself multiple times and it did not crash.
Change-Id: If32075d8e9c243cab254776b924248227520e030
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp')
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp index 43d3e46..3137163 100644 --- a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp @@ -192,6 +192,10 @@ void SOCKS5BytestreamServerManager::stop() { forwardPortRequest->stop(); forwardPortRequest.reset(); } + if (server) { + server->stop(); + server = NULL; + } if (connectionServer) { connectionServer->stop(); connectionServer.reset(); @@ -223,6 +227,7 @@ void SOCKS5BytestreamServerManager::handleForwardPortResult(boost::optional<NATP } portMapping = mapping; + onPortForwardingSetup(mapping.is_initialized()); forwardPortRequest->stop(); forwardPortRequest.reset(); |