diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-09-24 18:18:28 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-09-25 17:42:32 (GMT) |
commit | 94f87ffc9769f2782b2267db813854b0fe752678 (patch) | |
tree | 56244712ade2be0d4a0a093d7721d18050e74f87 /Swiften/Network/PlatformNATTraversalWorker.cpp | |
parent | 4f62e5ec4b42929fe3c1a68667e63cb1b7a35509 (diff) | |
download | swift-contrib-94f87ffc9769f2782b2267db813854b0fe752678.zip swift-contrib-94f87ffc9769f2782b2267db813854b0fe752678.tar.bz2 |
File transfer changes.
- Introduce 'experimental' flag to conditionally compile FT.
- Use LibMiniUPNPC and NATPMP CPPDEFINES only locally in the classes that need them.
- Extract abstract interface from NAT traversal classes
- Avoid unit test warnings
Diffstat (limited to 'Swiften/Network/PlatformNATTraversalWorker.cpp')
-rw-r--r-- | Swiften/Network/PlatformNATTraversalWorker.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Swiften/Network/PlatformNATTraversalWorker.cpp b/Swiften/Network/PlatformNATTraversalWorker.cpp index a4efedd..e0dcab5 100644 --- a/Swiften/Network/PlatformNATTraversalWorker.cpp +++ b/Swiften/Network/PlatformNATTraversalWorker.cpp @@ -14,7 +14,6 @@ #include <Swiften/Network/NATPMPNATTraversalGetPublicIPRequest.h> #include <Swiften/Network/NATPMPNATTraversalForwardPortRequest.h> #include <Swiften/Network/NATPMPNATTraversalRemovePortForwardingRequest.h> -#include <Swiften/Network/PlatformNATTraversalRemovePortForwardingRequest.h> namespace Swift { @@ -30,7 +29,7 @@ PlatformNATTraversalWorker::~PlatformNATTraversalWorker() { delete thread; } -boost::shared_ptr<PlatformNATTraversalGetPublicIPRequest> PlatformNATTraversalWorker::createGetPublicIPRequest() { +boost::shared_ptr<NATTraversalGetPublicIPRequest> PlatformNATTraversalWorker::createGetPublicIPRequest() { switch(backendType) { case UPnP: return boost::make_shared<UPnPNATTraversalGetPublicIPRequest>(this); @@ -40,12 +39,12 @@ boost::shared_ptr<PlatformNATTraversalGetPublicIPRequest> PlatformNATTraversalWo case None: break; } - return boost::shared_ptr<PlatformNATTraversalGetPublicIPRequest>(); + return boost::shared_ptr<NATTraversalGetPublicIPRequest>(); } -boost::shared_ptr<PlatformNATTraversalForwardPortRequest> PlatformNATTraversalWorker::createForwardPortRequest(unsigned int localPort, unsigned int publicPort) { - PlatformNATTraversalForwardPortRequest::PortMapping mapping; - mapping.protocol = PlatformNATTraversalForwardPortRequest::PortMapping::TCP; +boost::shared_ptr<NATTraversalForwardPortRequest> PlatformNATTraversalWorker::createForwardPortRequest(unsigned int localPort, unsigned int publicPort) { + NATTraversalForwardPortRequest::PortMapping mapping; + mapping.protocol = NATTraversalForwardPortRequest::PortMapping::TCP; mapping.leaseInSeconds = 60 * 60 * 24; mapping.localPort = localPort; mapping.publicPort = publicPort; @@ -59,12 +58,12 @@ boost::shared_ptr<PlatformNATTraversalForwardPortRequest> PlatformNATTraversalWo case None: break; } - return boost::shared_ptr<PlatformNATTraversalForwardPortRequest>(); + return boost::shared_ptr<NATTraversalForwardPortRequest>(); } -boost::shared_ptr<PlatformNATTraversalRemovePortForwardingRequest> PlatformNATTraversalWorker::createRemovePortForwardingRequest(unsigned int localPort, unsigned int publicPort) { - PlatformNATTraversalRemovePortForwardingRequest::PortMapping mapping; - mapping.protocol = PlatformNATTraversalRemovePortForwardingRequest::PortMapping::TCP; +boost::shared_ptr<NATTraversalRemovePortForwardingRequest> PlatformNATTraversalWorker::createRemovePortForwardingRequest(unsigned int localPort, unsigned int publicPort) { + NATTraversalRemovePortForwardingRequest::PortMapping mapping; + mapping.protocol = NATTraversalRemovePortForwardingRequest::PortMapping::TCP; mapping.leaseInSeconds = 60 * 60 * 24; mapping.localPort = localPort; mapping.publicPort = publicPort; @@ -78,7 +77,7 @@ boost::shared_ptr<PlatformNATTraversalRemovePortForwardingRequest> PlatformNATTr case None: break; } - return boost::shared_ptr<PlatformNATTraversalRemovePortForwardingRequest>(); + return boost::shared_ptr<NATTraversalRemovePortForwardingRequest>(); } void PlatformNATTraversalWorker::run() { |