summaryrefslogtreecommitdiffstats
path: root/aclk
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2020-04-16 10:07:12 +0300
committerGitHub <noreply@github.com>2020-04-16 10:07:12 +0300
commit84101a234a6c3e138c6be3a9dc4c03a89e689333 (patch)
tree65b7e06a25662248785dae43bdadbab0ae3f9fdd /aclk
parent467d6b71a85d0c60363ef0d1f6b4701d2fd370eb (diff)
Improved ACLK reconnection sequence (#8729)
Improved ACLK reconnection sequence
Diffstat (limited to 'aclk')
-rw-r--r--aclk/agent_cloud_link.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/aclk/agent_cloud_link.c b/aclk/agent_cloud_link.c
index a41d17e7bd..1c276f9919 100644
--- a/aclk/agent_cloud_link.c
+++ b/aclk/agent_cloud_link.c
@@ -1257,11 +1257,11 @@ static void aclk_try_to_connect(char *hostname, char *port, int port_num)
if (aclk_password == NULL)
return;
int rc;
+ aclk_connecting = 1;
rc = mqtt_attempt_connection(hostname, port_num, aclk_username, aclk_password);
if (unlikely(rc)) {
error("Failed to initialize the agent cloud link library");
}
- aclk_connecting = 1;
}
@@ -1355,6 +1355,8 @@ void *aclk_main(void *ptr)
}
_link_event_loop();
+ if (unlikely(!aclk_connected))
+ continue;
/*static int stress_counter = 0;
if (write_q_bytes==0 && stress_counter ++ >5)
{