← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3032: Fix NAT-PMP renewal

 

------------------------------------------------------------
revno: 3032
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2012-09-04 19:58:06 +0200
message:
  Fix NAT-PMP renewal
modified:
  changelog.txt
  dcpp/Mapper_NATPMP.cpp
  dcpp/Mapper_NATPMP.h


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt	2012-09-03 19:14:25 +0000
+++ changelog.txt	2012-09-04 17:58:06 +0000
@@ -36,6 +36,7 @@
 * [L#1039537] Fix a crash in Windows 8 (poy)
 * Update Boost to version 1.51
 * Merge 2 identical active mode settings (poy)
+* Fix NAT-PMP renewal (poy)
 
 -- 0.799 2012-05-05 --
 * Add icons (iceman50)

=== modified file 'dcpp/Mapper_NATPMP.cpp'
--- dcpp/Mapper_NATPMP.cpp	2012-06-18 15:56:01 +0000
+++ dcpp/Mapper_NATPMP.cpp	2012-09-04 17:58:06 +0000
@@ -105,7 +105,7 @@
 	if(sendRequest(port_, protocol, 3600)) {
 		natpmpresp_t response;
 		if(read(response) && response.type == respType(protocol) && response.pnu.newportmapping.mappedpublicport == port_) {
-			lifetime = std::min(lifetime ? lifetime : 3600, response.pnu.newportmapping.lifetime);
+			lifetime = std::min(lifetime ? lifetime : 3600, response.pnu.newportmapping.lifetime) / 60;
 			return true;
 		}
 	}

=== modified file 'dcpp/Mapper_NATPMP.h'
--- dcpp/Mapper_NATPMP.h	2012-01-13 20:55:20 +0000
+++ dcpp/Mapper_NATPMP.h	2012-09-04 17:58:06 +0000
@@ -45,7 +45,7 @@
 	const string& getName() const { return name; }
 
 	string gateway;
-	uint32_t lifetime;
+	uint32_t lifetime; // in minutes
 };
 
 } // dcpp namespace