Re: Connman sends tons of unnecessary queries
Reply #20 –
I stand corrected. There is a piece of code in src/wispr.c:
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;
} else {
g_web_set_address_family(wp_context->web, AF_INET6);
wp_context->status_url = STATUS_URL_IPV6;
}
/* ... */
}
This function is in turn called by __connman_wispr_start in two places: 1) in function redo_wispr and 2) in __connman_service_wispr_start.
1. redo_wispr is called by redo_wispr_ipv4 and redo_wispr_ipv6, which are both called only by __connman_service_online_check. This last function is called by: 1.1) portal_manage_status, but only if enable_online_to_ready_transition (set by configuration option) is non-zero, and by 1.2) wispr_portal_web_result, which is called by itself and wispr_portal_request_portal. This function is called by: 1.2.1) wispr_manage_message, which is called by wispr_portal_web_result and 1.2.2) proxy_callback, which is called by no_proxy_callback and wispr_portal_detect. So, a dead end.
2. __connman_service_wispr_start is called by: 2.1) wispr_portal_browser_reply_cb, 2.2) start_online_check, which is controlled by the configuration option, 2.3) set_property and 2.4) default_changed.
The functions set_property and default_changed are indeed called in multiple places.
Conclusion: this patch should introduce the absolute respecting of the configuration setting EnableOnlineCheck.
https://paste.artixlinux.org/18859960
Disclaimer: There could be interactions with regards to IPv4/IPv6 querying of localhost, or not.