Commit e062d944 authored by Jozef Kralik's avatar Jozef Kralik Committed by Kishen Maloor

Fix: set cloud_ep_state to DISCONNECTED

When cloud_ep is reset and cloud_ep_state is still set
as CONNECTED a it cause issue - cloud is not able to
reconnect because there is condition at cloud_ep_state.
Signed-off-by: default avatarJozef Kralik <jozef.kralik@kistler.com>
parent dd5280a2
Pipeline #118 passed with stage
in 48 seconds
......@@ -109,6 +109,7 @@ cloud_deregister_on_reset_internal(oc_cloud_context_t *ctx,
(void)data;
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
ctx->last_error = 0;
......@@ -152,6 +153,7 @@ oc_cloud_provision_conf_resource(oc_cloud_context_t *ctx, const char *server,
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
......@@ -183,6 +185,7 @@ cloud_update_by_resource(oc_cloud_context_t *ctx,
{
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
if (data->auth_provider && data->auth_provider_len) {
......@@ -311,6 +314,7 @@ oc_cloud_manager_stop(oc_cloud_context_t *ctx)
cloud_store_initialize(&ctx->store);
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
ctx->cloud_manager = false;
return 0;
}
......
......@@ -163,6 +163,7 @@ _register_handler(oc_cloud_context_t *ctx, oc_client_response_t *data)
strcmp(ci_server, value)) {
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
}
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