@@ -5662,32 +5662,47 @@ const char *connman_service_get_proxy_url(const struct connman_service *service)
return service->pac;
}
-void __connman_service_set_proxy_autoconfig(struct connman_service *service,
- const char *url)
+static bool service_set_proxy_method_auto_handler(
+ struct connman_service *service,
+ enum connman_service_proxy_method method,
+ const void *context)
{
- const bool dochanged = true;
-
- if (!service || service->hidden)
- return;
-
- service_set_pac(service, url, !dochanged);
-
- service->proxy = CONNMAN_SERVICE_PROXY_METHOD_AUTO;
+ const char * const url = context;
if (service->ipconfig_ipv4) {
if (__connman_ipconfig_set_proxy_autoconfig(
- service->ipconfig_ipv4, url) < 0)
- return;
+ service->ipconfig_ipv4, url) < 0)
+ return false;
} else if (service->ipconfig_ipv6) {
if (__connman_ipconfig_set_proxy_autoconfig(
- service->ipconfig_ipv6, url) < 0)
- return;
+ service->ipconfig_ipv6, url) < 0)
+ return false;
} else
- return;
+ return false;
- proxy_changed(service);
+ return true;
+}
+
+void __connman_service_set_proxy_autoconfig(struct connman_service *service,
+ const char *url)
+{
+ const bool dochanged = true;
+ const bool donotifier = true;
+ const void *context = url;
- __connman_notifier_proxy_changed(service);
+ DBG("service %p (%s) url %p (%s)",
+ service,
+ connman_service_get_identifier(service),
+ url,
+ url ? url : "<null>");
+
+ service_set_pac(service, url, !dochanged);
+
+ service_set_proxy_method(service,
+ CONNMAN_SERVICE_PROXY_METHOD_AUTO,
+ donotifier,
+ service_set_proxy_method_auto_handler,
+ context);
}
const char *connman_service_get_proxy_autoconfig(struct connman_service *service)