[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>
Wed, 12 Oct 2016 05:25:44 +0000 (05:25 +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>
resource/csdk/stack/src/ocstack.c

index bf7dde9e96962e3bcb4f8c8e945516686edabb72..6b236adbed5e036f520838c2ff09fb2d87210593 100644 (file)
@@ -2877,6 +2877,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)