Fix bug to prevent continuous presence TTL timeouts.
authorDoug Hudson <douglas.hudson@intel.com>
Fri, 24 Apr 2015 19:59:54 +0000 (15:59 -0400)
committerErich Keane <erich.keane@intel.com>
Sat, 25 Apr 2015 21:04:29 +0000 (21:04 +0000)
Change return value of static function's overflow condition to very
large value so that presence TTL timeout will not keep firing.

Change-Id: I63a79b692b13664ad62c95bec6657244df2ec9dd
Signed-off-by: Doug Hudson <douglas.hudson@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/831
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/include/ocstack.h
resource/csdk/stack/src/ocstack.c

index 0ceded3..4e632f5 100644 (file)
@@ -47,6 +47,9 @@ extern "C" {
 
 #ifdef WITH_PRESENCE
 #define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
+/// OC_MAX_PRESENCE_TTL_SECONDS sets the maximum time to live (TTL) for presence.
+/// NOTE: Changing the setting to a longer duration may lead to unsupported and untested
+/// operation.
 #define OC_MAX_PRESENCE_TTL_SECONDS     (60 * 60 * 24) // 60 sec/min * 60 min/hr * 24 hr/day
 #define OC_PRESENCE_URI                      "/oc/presence"
 #endif
index 09432d9..5811694 100644 (file)
@@ -453,7 +453,7 @@ uint32_t GetTicks(uint32_t afterMilliSeconds)
     }
     else
     {
-        return now;
+        return UINT32_MAX;
     }
 }