summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp')
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp
index f749735..a6b75da 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServerManager.cpp
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2012-2016 Isode Limited.
+ * Copyright (c) 2012-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
/*
* Copyright (c) 2011 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
@@ -108,19 +108,19 @@ bool SOCKS5BytestreamServerManager::isInitialized() const {
return state == Initialized;
}
void SOCKS5BytestreamServerManager::initialize() {
if (state == Start) {
state = Initializing;
// Find a port to listen on
assert(!connectionServer);
- int port;
+ unsigned short port;
for (port = LISTEN_PORTS_BEGIN; port < LISTEN_PORTS_END; ++port) {
SWIFT_LOG(debug) << "Trying to start server on port " << port << std::endl;
connectionServer = connectionServerFactory->createConnectionServer(HostAddress::fromString("::").get(), port);
boost::optional<ConnectionServer::Error> error = connectionServer->tryStart();
if (!error) {
break;
}
else if (*error != ConnectionServer::Conflict) {
SWIFT_LOG(debug) << "Error starting server" << std::endl;
@@ -158,19 +158,19 @@ void SOCKS5BytestreamServerManager::setupPortForwarding() {
assert(!getPublicIPRequest);
publicAddress = boost::optional<HostAddress>();
if ((getPublicIPRequest = natTraverser->createGetPublicIPRequest())) {
getPublicIPRequest->onResult.connect(
boost::bind(&SOCKS5BytestreamServerManager::handleGetPublicIPResult, this, _1));
getPublicIPRequest->start();
}
// Forward ports
- int port = server->getAddressPort().getPort();
+ auto port = server->getAddressPort().getPort();
assert(!forwardPortRequest);
portMapping = boost::optional<NATPortMapping>();
if ((forwardPortRequest = natTraverser->createForwardPortRequest(port, port))) {
forwardPortRequest->onResult.connect(
boost::bind(&SOCKS5BytestreamServerManager::handleForwardPortResult, this, _1));
forwardPortRequest->start();
}
}