Commit 09c7f925 authored by Kishen Maloor's avatar Kishen Maloor

Merge branch 'essen' into fargo

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parents 2ddaaba6 14daed99
Pipeline #1157 passed with stage
in 5 minutes and 23 seconds
...@@ -115,6 +115,7 @@ static void ...@@ -115,6 +115,7 @@ static void
cloud_start_process(oc_cloud_context_t *ctx) cloud_start_process(oc_cloud_context_t *ctx)
{ {
ctx->retry_count = 0; ctx->retry_count = 0;
ctx->retry_refresh_token_count = 0;
if (ctx->store.status == OC_CLOUD_INITIALIZED) { if (ctx->store.status == OC_CLOUD_INITIALIZED) {
oc_set_delayed_callback(ctx, cloud_register, session_timeout[0]); oc_set_delayed_callback(ctx, cloud_register, session_timeout[0]);
...@@ -497,7 +498,7 @@ refresh_token(void *data) ...@@ -497,7 +498,7 @@ refresh_token(void *data)
if (cannotConnect) { if (cannotConnect) {
cloud_set_last_error(ctx, CLOUD_ERROR_REFRESH_ACCESS_TOKEN); cloud_set_last_error(ctx, CLOUD_ERROR_REFRESH_ACCESS_TOKEN);
} }
oc_set_delayed_callback(ctx, cloud_login, oc_set_delayed_callback(ctx, refresh_token,
session_timeout[ctx->retry_refresh_token_count]); session_timeout[ctx->retry_refresh_token_count]);
} }
......
...@@ -251,6 +251,10 @@ void ...@@ -251,6 +251,10 @@ void
cloud_rd_manager_status_changed(oc_cloud_context_t *ctx) cloud_rd_manager_status_changed(oc_cloud_context_t *ctx)
{ {
if (ctx->store.status & OC_CLOUD_LOGGED_IN) { if (ctx->store.status & OC_CLOUD_LOGGED_IN) {
if (ctx->store.status & OC_CLOUD_REFRESHED_TOKEN) {
// when refresh occurs we don't want to publish resources.
return;
}
publish_published_resources(ctx); publish_published_resources(ctx);
delete_resources(ctx, false); delete_resources(ctx, false);
oc_remove_delayed_callback(ctx, publish_published_resources); oc_remove_delayed_callback(ctx, publish_published_resources);
......
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