* If some error is occured while ownership transfer,
* ownership transfer related resource should be revert back to initial status.
*/
- if(previousMsgId != ehRequest->messageID)
+ const OicSecDoxm_t* doxm = GetDoxmResourceData();
+ if(doxm)
{
- OIC_LOG(WARNING, TAG, "The operation failed during handle DOXM request,"\
- "DOXM will be reverted.");
- RestoreDoxmToInitState();
- RestorePstatToInitState();
+ if(!doxm->owned && previousMsgId != ehRequest->messageID)
+ {
+ OIC_LOG(WARNING, TAG, "The operation failed during handle DOXM request,"\
+ "DOXM will be reverted.");
+ RestoreDoxmToInitState();
+ RestorePstatToInitState();
+ }
+ }
+ else
+ {
+ OIC_LOG(ERROR, TAG, "Invalid DOXM resource");
}
}
}
{
if(!gDoxm->owned && previousMsgId != ehRequest->messageID)
{
- OIC_LOG(WARNING, TAG, "The operation failed during handle DOXM request,"\
- "DOXM will be reverted.");
RestoreDoxmToInitState();
RestorePstatToInitState();
}
prevMsgId = ehRequest->messageID;
}
-
// Send response payload to request originator
ehRet = ((SendSRMResponse(ehRequest, ehRet, NULL, 0)) == OC_STACK_OK) ?
OC_EH_OK : OC_EH_ERROR;