From: Doug Hudson Date: Fri, 24 Apr 2015 19:59:54 +0000 (-0400) Subject: Fix bug to prevent continuous presence TTL timeouts. X-Git-Tag: 1.2.0+RC1~1790 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fc29245ef9df28b355ff6866bb213862dd6bb51;p=platform%2Fupstream%2Fiotivity.git Fix bug to prevent continuous presence TTL timeouts. 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/831 Tested-by: jenkins-iotivity Reviewed-by: Mandeep Shetty Reviewed-by: Erich Keane --- diff --git a/resource/csdk/stack/include/ocstack.h b/resource/csdk/stack/include/ocstack.h index 0ceded3..4e632f5 100644 --- a/resource/csdk/stack/include/ocstack.h +++ b/resource/csdk/stack/include/ocstack.h @@ -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 diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index 09432d9..5811694 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -453,7 +453,7 @@ uint32_t GetTicks(uint32_t afterMilliSeconds) } else { - return now; + return UINT32_MAX; } }