Commit 5dbfa668 authored by Sushil Yadav's avatar Sushil Yadav Committed by Ashok Babu Channa

[IOT-1893] Delete Request Logic Fixed.

Change-Id: I0df40af7c198e3e26aa5450da3489e5876628acc
Signed-off-by: default avatarSushil Yadav <sushil.ky@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19743Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: default avatarAshok Babu Channa <ashok.channa@samsung.com>
parent 5742af47
......@@ -777,7 +777,11 @@ void* RequestDeleteDeathResourceTask(void* myqos)
if (OC_STACK_OK != result)
{
OIC_LOG(INFO, TAG, "Second DELETE call did not succeed");
OIC_LOG(INFO, TAG, "Second DELETE Request also failed");
}
else
{
OIC_LOG(INFO, TAG, "Second DELETE Request sent successfully; Waiting for Callback");
}
return NULL;
......@@ -798,16 +802,15 @@ int InitDeleteRequest(OCQualityOfService qos)
if (OC_STACK_OK != result)
{
// Error can happen if for example, network connectivity is down
OIC_LOG(INFO, TAG, "First DELETE call did not succeed");
}
else
{
OIC_LOG(INFO, TAG, "DELETE Request did not succeed; Will try again.");
//Create a thread to delete this resource again
pthread_t threadId;
pthread_create (&threadId, NULL, RequestDeleteDeathResourceTask, (void*)qos);
}
OIC_LOG_V(INFO, TAG, "\n\nExit %s", __func__);
else
{
OIC_LOG(INFO, TAG, "DELETE Request sent successfully; Waiting for Callback");
}
return result;
}
......
......@@ -369,7 +369,7 @@ OCEntityHandlerResult ProcessDeleteRequest (OCEntityHandlerRequest *ehRequest)
if (result == OC_STACK_OK)
{
OIC_LOG (INFO, TAG, "\n\nDelete Resource operation succeeded.");
ehResult = OC_EH_OK;
ehResult = OC_EH_RESOURCE_DELETED;
//Step 2: clear observers who wanted to observe this resource at the app level.
for (uint8_t i = 0; i < SAMPLE_MAX_NUM_OBSERVATIONS; i++)
......@@ -385,7 +385,7 @@ OCEntityHandlerResult ProcessDeleteRequest (OCEntityHandlerRequest *ehRequest)
else if (result == OC_STACK_NO_RESOURCE)
{
OIC_LOG(INFO, TAG, "\n\nThe resource doesn't exist or it might have been deleted.");
ehResult = OC_EH_RESOURCE_DELETED;
ehResult = OC_EH_RESOURCE_NOT_FOUND;
}
else
{
......@@ -1129,7 +1129,7 @@ int main(int argc, char* argv[])
OCSetRAInfo(&rainfo);
#endif
OIC_LOG(DEBUG, TAG, "OCServer is starting...");
OCPersistentStorage pstStr {
server_fopen,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment