diff options
Diffstat (limited to 'src/aclk/aclk.c')
-rw-r--r-- | src/aclk/aclk.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/aclk/aclk.c b/src/aclk/aclk.c index 627edfc9..389d7455 100644 --- a/src/aclk/aclk.c +++ b/src/aclk/aclk.c @@ -600,6 +600,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) url_t mqtt_url; #endif + bool fallback_ipv4 = false; while (service_running(SERVICE_ACLK)) { aclk_cloud_base_url = appconfig_get(&cloud_config, CONFIG_SECTION_GLOBAL, "cloud base url", NULL); if (aclk_cloud_base_url == NULL) { @@ -646,7 +647,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) } aclk_env = callocz(1, sizeof(aclk_env_t)); - ret = aclk_get_env(aclk_env, base_url.host, base_url.port); + ret = aclk_get_env(aclk_env, base_url.host, base_url.port, &fallback_ipv4); url_t_destroy(&base_url); if(ret) switch(ret) { case 1: @@ -714,7 +715,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) continue; } - ret = aclk_get_mqtt_otp(aclk_private_key, (char **)&mqtt_conn_params.clientid, (char **)&mqtt_conn_params.username, (char **)&mqtt_conn_params.password, &auth_url); + ret = aclk_get_mqtt_otp(aclk_private_key, (char **)&mqtt_conn_params.clientid, (char **)&mqtt_conn_params.username, (char **)&mqtt_conn_params.password, &auth_url, &fallback_ipv4); url_t_destroy(&auth_url); if (ret) { aclk_status = ACLK_STATUS_INVALID_OTP; @@ -759,7 +760,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) ret = mqtt_wss_connect(client, base_url.host, base_url.port, &mqtt_conn_params, ACLK_SSL_FLAGS, &proxy_conf); url_t_destroy(&base_url); #else - ret = mqtt_wss_connect(client, mqtt_url.host, mqtt_url.port, &mqtt_conn_params, ACLK_SSL_FLAGS, &proxy_conf); + ret = mqtt_wss_connect(client, mqtt_url.host, mqtt_url.port, &mqtt_conn_params, ACLK_SSL_FLAGS, &proxy_conf, &fallback_ipv4); url_t_destroy(&mqtt_url); freez((char*)mqtt_conn_params.clientid); @@ -778,6 +779,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) aclk_status = ACLK_STATUS_CONNECTED; nd_log(NDLS_ACCESS, NDLP_INFO, "ACLK CONNECTED"); mqtt_connected_actions(client); + fallback_ipv4 = false; return 0; } |