Modify response logic for NSTopicEntityHandler.
authorjaesick.shin <jaesick.shin@samsung.com>
Wed, 24 Aug 2016 08:48:59 +0000 (17:48 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 25 Aug 2016 04:45:50 +0000 (04:45 +0000)
two times, send response.

second patch included,
remove the DoResponse for error case.

Change-Id: Ife6e8b87868afa6307ed82ca41430b1837c56798
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10879
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/notification/src/provider/NSProviderListener.c

index 6a1a86ecad3cba00b9a39487d54443c2e3c1142f..01011f99b666f63487bb7347069380983a0f4484 100644 (file)
@@ -215,12 +215,6 @@ OCEntityHandlerResult NSEntityHandlerTopicCb(OCEntityHandlerFlag flag,
 \r
     (void)callback;\r
 \r
-    OCEntityHandlerResponse response;\r
-    response.numSendVendorSpecificHeaderOptions = 0;\r
-    memset(response.sendVendorSpecificHeaderOptions, 0,\r
-            sizeof response.sendVendorSpecificHeaderOptions);\r
-    memset(response.resourceUri, 0, sizeof response.resourceUri);\r
-\r
     if (!entityHandlerRequest)\r
     {\r
         NS_LOG(ERROR, "Invalid request pointer");\r
@@ -264,22 +258,10 @@ OCEntityHandlerResult NSEntityHandlerTopicCb(OCEntityHandlerFlag flag,
         {\r
             NS_LOG_V(DEBUG, "Received unsupported method %d from client",\r
                     entityHandlerRequest->method);\r
-            ehResult = OC_EH_OK;\r
+            ehResult = OC_EH_ERROR;\r
         }\r
     }\r
 \r
-    response.requestHandle = entityHandlerRequest->requestHandle;\r
-    response.resourceHandle = entityHandlerRequest->resource;\r
-    response.persistentBufferFlag = 0;\r
-    response.ehResult = ehResult;\r
-    response.payload = (OCPayload *) NULL;\r
-\r
-    if (OCDoResponse(&response) != OC_STACK_OK)\r
-    {\r
-        NS_LOG(ERROR, "Fail to AccessPolicy send response");\r
-        return NS_ERROR;\r
-    }\r
-\r
     NS_LOG(DEBUG, "NSEntityHandlerTopicCb - OUT");\r
     return ehResult;\r
 }\r