Merge "Fix crash caused by decryption response delay" into tizen
[platform/upstream/connman.git] / src / wispr.c
index 4674ae4..f4dcb73 100755 (executable)
@@ -30,9 +30,6 @@
 
 #include "connman.h"
 
-#define STATUS_URL_IPV4  "http://ipv4.connman.net/online/status.html"
-#define STATUS_URL_IPV6  "http://ipv6.connman.net/online/status.html"
-
 struct connman_wispr_message {
        bool has_error;
        const char *current_element;
@@ -96,6 +93,8 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data);
 
 static GHashTable *wispr_portal_list = NULL;
 
+static char *online_check_ipv4_url = NULL;
+static char *online_check_ipv6_url = NULL;
 static bool enable_online_to_ready_transition = false;
 
 static void connman_wispr_message_init(struct connman_wispr_message *msg)
@@ -426,7 +425,8 @@ static void wispr_portal_error(struct connman_wispr_portal_context *wp_context)
        wp_context->wispr_result = CONNMAN_WISPR_RESULT_FAILED;
 
 #if defined TIZEN_EXT
-       connman_service_set_internet_connection(wp_context->service, false);
+       if (TIZEN_INS_ENABLED)
+               connman_service_set_internet_connection(wp_context->service, false);
 #endif
 }
 
@@ -937,10 +937,10 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context)
 
        if (wp_context->type == CONNMAN_IPCONFIG_TYPE_IPV4) {
                g_web_set_address_family(wp_context->web, AF_INET);
-               wp_context->status_url = STATUS_URL_IPV4;
+               wp_context->status_url = online_check_ipv4_url;
        } else {
                g_web_set_address_family(wp_context->web, AF_INET6);
-               wp_context->status_url = STATUS_URL_IPV6;
+               wp_context->status_url = online_check_ipv6_url;
        }
 
        for (i = 0; nameservers[i]; i++)
@@ -1062,6 +1062,11 @@ int __connman_wispr_init(void)
                                                g_direct_equal, NULL,
                                                free_connman_wispr_portal);
 
+       online_check_ipv4_url =
+               connman_setting_get_string("OnlineCheckIPv4URL");
+       online_check_ipv6_url =
+               connman_setting_get_string("OnlineCheckIPv6URL");
+
        enable_online_to_ready_transition =
                connman_setting_get_bool("EnableOnlineToReadyTransition");