Commit e79f5789 authored by Kishen Maloor's avatar Kishen Maloor

oc_cloud:clear ctx->cloud_ep on RESET/cis change

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
Change-Id: I057ece05cf9676600424c8a72a0b8419113ceecb
parent fc444572
......@@ -108,6 +108,7 @@ cloud_deregister_on_reset_internal(oc_cloud_context_t *ctx,
(void)status;
(void)data;
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
ctx->last_error = 0;
......@@ -309,6 +310,7 @@ oc_cloud_manager_stop(oc_cloud_context_t *ctx)
cloud_manager_stop(ctx);
cloud_store_initialize(&ctx->store);
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_manager = false;
return 0;
}
......
......@@ -162,6 +162,7 @@ _register_handler(oc_cloud_context_t *ctx, oc_client_response_t *data)
if (!ci_server || oc_string_len(ctx->store.ci_server) != size ||
strcmp(ci_server, value)) {
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
}
cloud_set_string(&ctx->store.ci_server, value, size);
}
......
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