summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-09-26 20:44:41 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-09-26 20:45:27 (GMT)
commit4b61e7363dbc0e8bf595da06840db4175e3b86c3 (patch)
treed33f51dec98251cf581da4ced909d07ebb2ecd24 /Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp
parentdf957dbaaa42330ff888e42fe6f2d31c01d8129d (diff)
downloadswift-contrib-4b61e7363dbc0e8bf595da06840db4175e3b86c3.zip
swift-contrib-4b61e7363dbc0e8bf595da06840db4175e3b86c3.tar.bz2
Refactoring NetworkEnvironments.
Diffstat (limited to 'Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp')
-rw-r--r--Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp b/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp
index 6e4d0eb..9b83173 100644
--- a/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp
+++ b/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp
@@ -36,7 +36,7 @@ void UPnPNATTraversalRemovePortForwardingRequest::runBlocking() {
std::string publicPort = str(boost::format("%d") % mapping.publicPort);
std::string localPort = str(boost::format("%d") % mapping.localPort);
- std::string internalClient = getLocalClient().toString();
+ std::string internalClient = PlatformNetworkEnvironment().getLocalAddress().toString();
std::string leaseSeconds = str(boost::format("%d") % mapping.leaseInSeconds);
UPNPUrls urls;
IGDdatas data;
@@ -74,19 +74,4 @@ void UPnPNATTraversalRemovePortForwardingRequest::runBlocking() {
onResult(result);
}
-HostAddress UPnPNATTraversalRemovePortForwardingRequest::getLocalClient() {
- PlatformNetworkEnvironment env;
-
- foreach (NetworkInterface::ref iface, env.getNetworkInterfaces()) {
- if (!iface->isLoopback()) {
- foreach (HostAddress address, iface->getAddresses()) {
- if (address.getRawAddress().is_v4()) {
- return address;
- }
- }
- }
- }
- return HostAddress();
-}
-
}