From: jaesick.shin Date: Wed, 24 Aug 2016 08:48:59 +0000 (+0900) Subject: Modify response logic for NSTopicEntityHandler. X-Git-Tag: 1.2.0+RC1~52^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2ca1cb668fdbd5f597358c27c242ee43dfd9198;p=platform%2Fupstream%2Fiotivity.git Modify response logic for NSTopicEntityHandler. two times, send response. second patch included, remove the DoResponse for error case. Change-Id: Ife6e8b87868afa6307ed82ca41430b1837c56798 Signed-off-by: jaesick.shin Reviewed-on: https://gerrit.iotivity.org/gerrit/10879 Reviewed-by: Uze Choi Tested-by: Uze Choi --- diff --git a/service/notification/src/provider/NSProviderListener.c b/service/notification/src/provider/NSProviderListener.c index 6a1a86eca..01011f99b 100644 --- a/service/notification/src/provider/NSProviderListener.c +++ b/service/notification/src/provider/NSProviderListener.c @@ -215,12 +215,6 @@ OCEntityHandlerResult NSEntityHandlerTopicCb(OCEntityHandlerFlag flag, (void)callback; - OCEntityHandlerResponse response; - response.numSendVendorSpecificHeaderOptions = 0; - memset(response.sendVendorSpecificHeaderOptions, 0, - sizeof response.sendVendorSpecificHeaderOptions); - memset(response.resourceUri, 0, sizeof response.resourceUri); - if (!entityHandlerRequest) { NS_LOG(ERROR, "Invalid request pointer"); @@ -264,22 +258,10 @@ OCEntityHandlerResult NSEntityHandlerTopicCb(OCEntityHandlerFlag flag, { NS_LOG_V(DEBUG, "Received unsupported method %d from client", entityHandlerRequest->method); - ehResult = OC_EH_OK; + ehResult = OC_EH_ERROR; } } - response.requestHandle = entityHandlerRequest->requestHandle; - response.resourceHandle = entityHandlerRequest->resource; - response.persistentBufferFlag = 0; - response.ehResult = ehResult; - response.payload = (OCPayload *) NULL; - - if (OCDoResponse(&response) != OC_STACK_OK) - { - NS_LOG(ERROR, "Fail to AccessPolicy send response"); - return NS_ERROR; - } - NS_LOG(DEBUG, "NSEntityHandlerTopicCb - OUT"); return ehResult; }