diff options
author | Andrew Moss <1043609+amoss@users.noreply.github.com> | 2020-04-17 22:55:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 22:55:14 +0200 |
commit | 4fe1cb90bf88b131aa9b9cf7d2600277ac94d553 (patch) | |
tree | d974afbb4cafb7ba2f628af11da0af8e61e6037f /aclk | |
parent | 96462a406253f1ea500bd530ab56203ceabb4fcd (diff) |
Additional cases for the thread exit fix (#8750)
Diffstat (limited to 'aclk')
-rw-r--r-- | aclk/agent_cloud_link.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/aclk/agent_cloud_link.c b/aclk/agent_cloud_link.c index a14bfec392..e59c9ea413 100644 --- a/aclk/agent_cloud_link.c +++ b/aclk/agent_cloud_link.c @@ -1277,11 +1277,11 @@ static void aclk_try_to_connect(char *hostname, char *port, int port_num) */ void *aclk_main(void *ptr) { + struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr; struct netdata_static_thread *query_thread; if (!netdata_cloud_setting) { info("Killing ACLK thread -> cloud functionality has been disabled"); - struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr; static_thread->enabled = NETDATA_MAIN_THREAD_EXITED; return NULL; } @@ -1300,6 +1300,7 @@ void *aclk_main(void *ptr) char *cloud_base_url = config_get(CONFIG_SECTION_CLOUD, "cloud base url", DEFAULT_CLOUD_BASE_URL); if (aclk_decode_base_url(cloud_base_url, &aclk_hostname, &aclk_port)) { error("Configuration error - cannot use agent cloud link"); + static_thread->enabled = NETDATA_MAIN_THREAD_EXITED; return NULL; } port_num = atoi(aclk_port); // SSL library uses the string, MQTT uses the numeric value |