From 53a4a4a56407e4e61e282af40b4b83fbaee7939a Mon Sep 17 00:00:00 2001 From: Yamin S Al-mousa Date: Mon, 6 Oct 2014 16:52:15 -0700 Subject: [PATCH] Fixing returned error codes in OCProcessPresence. Change-Id: I1976a240bdd440708acfc4e10bfc0bc06437c35a --- csdk/stack/src/ocstack.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/csdk/stack/src/ocstack.c b/csdk/stack/src/ocstack.c index 78aa0d0..ebaae39 100644 --- a/csdk/stack/src/ocstack.c +++ b/csdk/stack/src/ocstack.c @@ -527,7 +527,7 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption #ifdef WITH_PRESENCE OCStackResult OCProcessPresence() { - OCStackResult result = OC_STACK_ERROR; + OCStackResult result = OC_STACK_OK; uint8_t ipAddr[4] = { 0 }; uint16_t port = 0; @@ -570,6 +570,7 @@ OCStackResult OCProcessPresence() } else { + result = OC_STACK_INVALID_IP; goto exit; } HandleStackResponses(response); @@ -581,6 +582,10 @@ OCStackResult OCProcessPresence() OCGenerateCoAPToken(&token); result = OCDoCoAPResource(OC_REST_GET, OC_NON_CONFIRMABLE, &token, (const char *)cbNode->requestUri, NULL, NULL, 0); + if(result != OC_STACK_OK) + { + goto exit; + } cbNode->presence->TTLlevel++; OC_LOG_V(DEBUG, TAG, "----------------moving to TTL level %d", cbNode->presence->TTLlevel); } -- 2.7.4