Commit 921371e7 authored by Kishen Maloor's avatar Kishen Maloor

oc_cloud:persist cloudconf after deregistrations

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent caf3259e
......@@ -232,13 +232,10 @@ cloud_deregistered_internal(oc_client_response_t *data)
cloud_api_param_t *p = (cloud_api_param_t *)data->user_data;
oc_cloud_context_t *ctx = p->ctx;
if (data->code >= OC_STATUS_SERVICE_UNAVAILABLE) {
cloud_set_last_error(ctx, CLOUD_ERROR_CONNECT);
ctx->store.status |= OC_CLOUD_FAILURE;
ctx->store.status = OC_CLOUD_DEREGISTERED;
} else if (data->code >= OC_STATUS_BAD_REQUEST) {
cloud_set_last_error(ctx, CLOUD_ERROR_RESPONSE);
ctx->store.status |= OC_CLOUD_FAILURE;
} else {
ctx->store.status = OC_CLOUD_DEREGISTERED;
}
ctx->store.cps = OC_CPS_READYTOREGISTER;
......@@ -249,6 +246,8 @@ cloud_deregistered_internal(oc_client_response_t *data)
free_api_param(p);
ctx->store.status &= ~(OC_CLOUD_FAILURE | OC_CLOUD_DEREGISTERED);
cloud_store_dump_async(&ctx->store);
}
int
......
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