X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fwispr.c;h=3b203fba7c57244cfdd252a9a7da8ed3c6a74d53;hb=17c2dfb865433db2e64f1e64fcd5fac7cb445c23;hp=a2df55a0b133a7b60594e58b9b8847af028f939e;hpb=d04bfa0350781ebfb8cbb2e64fabdfb2f36cd302;p=platform%2Fupstream%2Fconnman.git diff --git a/src/wispr.c b/src/wispr.c old mode 100644 new mode 100755 index a2df55a..3b203fb --- a/src/wispr.c +++ b/src/wispr.c @@ -422,6 +422,10 @@ static void wispr_portal_error(struct connman_wispr_portal_context *wp_context) DBG("Failed to proceed wispr/portal web request"); wp_context->wispr_result = CONNMAN_WISPR_RESULT_FAILED; + +#if defined TIZEN_EXT + connman_service_set_internet_connection(wp_context->service, false); +#endif } static void portal_manage_status(GWebResult *result, @@ -555,12 +559,31 @@ static void wispr_portal_browser_reply_cb(struct connman_service *service, const char *error, void *user_data) { struct connman_wispr_portal_context *wp_context = user_data; + struct connman_wispr_portal *wispr_portal; + int index; DBG(""); if (!service || !wp_context) return; + /* + * No way to cancel this if wp_context has been freed, so we lookup + * from the service and check that this is still the right context. + */ + index = __connman_service_get_index(service); + if (index < 0) + return; + + wispr_portal = g_hash_table_lookup(wispr_portal_list, + GINT_TO_POINTER(index)); + if (!wispr_portal) + return; + + if (wp_context != wispr_portal->ipv4_context && + wp_context != wispr_portal->ipv6_context) + return; + if (!authentication_done) { wispr_portal_error(wp_context); free_wispr_routes(wp_context); @@ -568,7 +591,7 @@ static void wispr_portal_browser_reply_cb(struct connman_service *service, } /* Restarting the test */ - __connman_wispr_start(service, wp_context->type); + __connman_service_wispr_start(service, wp_context->type); } static void wispr_portal_request_wispr_login(struct connman_service *service, @@ -688,6 +711,9 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) const char *str = NULL; guint16 status; gsize length; +#if defined TIZEN_MAINTAIN_ONLINE + static int retried = 0; +#endif DBG(""); @@ -719,6 +745,9 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) wp_context->status_url, wp_context); break; case 200: +#if defined TIZEN_MAINTAIN_ONLINE + retried = 0; +#endif if (wp_context->wispr_msg.message_type >= 0) break; @@ -756,6 +785,19 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data) case 404: if (__connman_service_online_check_failed(wp_context->service, wp_context->type) == 0) { +#if defined TIZEN_MAINTAIN_ONLINE + if (wp_context->type == CONNMAN_IPCONFIG_TYPE_IPV4) { + if (retried == 0) { + connman_agent_report_error(wp_context->service, + __connman_service_get_path(wp_context->service), + "internet-unreachable", + NULL, NULL, NULL); + + retried = 1; + } + break; + } +#endif wispr_portal_error(wp_context); free_connman_wispr_portal_context(wp_context); return false;