[IOT-1434] fix subscribe presence for multicast.
authorjihwan.seo <jihwan.seo@samsung.com>
Fri, 7 Oct 2016 10:02:06 +0000 (19:02 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 20 Oct 2016 07:51:50 +0000 (07:51 +0000)
it causes a big memory issue to add in serverRequestList.
because this request never remove

and subscribe presence for multicast should be not sent
on network.
since it is just for register clientCB in stack.

Change-Id: I14c9701009350ad52dfdf4e72db64522fc591705
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12941
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: JungYong KIM <jyong2.kim@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 45b9f4b4dade573f698f307c421c107d6190653f)
Reviewed-on: https://gerrit.iotivity.org/gerrit/13383

resource/csdk/stack/src/ocstack.c

index 1dd43aa..1365aaa 100644 (file)
@@ -2897,6 +2897,21 @@ OCStackResult OCDoResource(OCDoHandle *handle,
     resourceUri = NULL;   // Client CB list entry now owns it
     resourceType = NULL;  // Client CB list entry now owns it
 
+#ifdef WITH_PRESENCE
+    if (method == OC_REST_PRESENCE)
+    {
+        if (requestInfo.isMulticast)
+        {
+            OIC_LOG(ERROR, TAG, "AddClientCB for presence done.");
+            goto exit;
+        }
+        else
+        {
+            OIC_LOG(ERROR, TAG, "this subscribe presence is unicast.");
+        }
+    }
+#endif
+
     // send request
     result = OCSendRequest(&endpoint, &requestInfo);
     if (OC_STACK_OK != result)