Fixed broken observation cancellation.
authorMandeep Shetty <mandeep.shetty@intel.com>
Mon, 13 Jul 2015 02:15:37 +0000 (19:15 -0700)
committerErich Keane <erich.keane@intel.com>
Mon, 13 Jul 2015 17:44:56 +0000 (17:44 +0000)
Observe Cancel was broken because the uri from the client callback was
not copied into the request object. This caused connectivity to eat the
request witout sending it out.

Change-Id: Ib0ab815647897f2815fdffc3011e9977a003ac5f
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1637
Reviewed-by: Omkar Hegde <omkar.m.hegde@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/src/ocstack.c

index 19bdc95..7447960 100644 (file)
@@ -2266,6 +2266,8 @@ OCStackResult OCCancel(OCDoHandle handle, OCQualityOfService qos, OCHeaderOption
                 return OC_STACK_ERROR;
             }
             requestData.numOptions = numOptions + 1;
+            requestData.resourceUri = OICStrdup (clientCB->requestUri);
+
             requestInfo.method = CA_GET;
             requestInfo.info = requestData;
 
@@ -2303,6 +2305,10 @@ Error:
     {
         OICFree(requestData.options);
     }
+    if (requestData.resourceUri)
+    {
+        OICFree (requestData.resourceUri);
+    }
 
     return ret;
 }