If an error is returned during ownership transfer,
on-boarding tool needs to remove the server's information from PDM DB
and close secure connection with the server.
Patch #1: Initial patch
Patch #2: Change Log Level
Change-Id: I641529552de0e25438bd94da9b2ec45320428a61
Signed-off-by: Jongmin Choi <jminl.choi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14999
Reviewed-by: Chul Lee <chuls.lee@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jongsung Lee <js126.lee@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
if(OC_STACK_OK != res && OC_STACK_CONTINUE != res && OC_STACK_DUPLICATE_REQUEST != res)
{
otmCtx->ctxHasError = true;
+ if (OC_STACK_OK != PDMDeleteDevice(&otmCtx->ctxResultArray[i].deviceId))
+ {
+ OIC_LOG(WARNING, TAG, "Internal error in PDMDeleteDevice");
+ }
+ CAEndpoint_t* endpoint = (CAEndpoint_t *)&otmCtx->selectedDeviceInfo->endpoint;
+ endpoint->port = otmCtx->selectedDeviceInfo->securePort;
+ if (CA_STATUS_OK != CAcloseSslConnection(endpoint))
+ {
+ OIC_LOG(WARNING, TAG, "Failed to close Secure session");
+ }
}
}
}