From: jihwan.seo Date: Fri, 10 Feb 2017 04:24:24 +0000 (+0900) Subject: Fix callback issue which there is no payload in case of error message. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6a32d371a3e13ae8618d23dc0e2b559c26fc262;p=contrib%2Fiotivity.git Fix callback issue which there is no payload in case of error message. check logic what payload is parsed was modified in https://gerrit.iotivity.org/gerrit/#/c/15197/. However that change cause some issue which there is no payload in case of error message with general get/put/post/delete message except for oic/res. payload should be set in common in OCHandleResponse method. Change-Id: I0c415022e35573ae76e730d9973206d218f18174 Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/17165 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Habib Virji Reviewed-by: Ashok Babu Channa --- diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index 6bb5d27..3cdaecb 100644 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -1503,8 +1503,9 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp OICFree(response); return; } + // In case of error, still want application to receive the error message. - if (OCResultToSuccess(response->result)) + if (OCResultToSuccess(response->result) || PAYLOAD_TYPE_REPRESENTATION == type) { if (OC_STACK_OK != OCParsePayload(&response->payload, type,