diff mbox series

service: Leverage 'connman_service_set_proxy_method'.

Message ID 20231116045404.638187-1-gerickson@nuovations.com (mailing list archive)
State Superseded
Headers show
Series service: Leverage 'connman_service_set_proxy_method'. | expand

Commit Message

Grant Erickson Nov. 16, 2023, 4:54 a.m. UTC
Previously, inside 'check_proxy_method', if WPAD failed for any reason
the code would explicitly manipulate the 'proxy' field of the service
object and then invoke '__connman_notifier_proxy_changed'.

However, when 'method' is 'CONNMAN_SERVICE_PROXY_METHOD_DIRECT', which
is the case in 'check_proxy_method', this is 2/3 of what
'connman_service_set_proxy_method' already does. The 1/3  difference is
that 'connman_service_set_proxy_method' calls 'proxy_changed'.

Consequently, since there does not seem to be a well-documented or
compelling reason to avoid the call to 'proxy_changed', simply leverage
and call 'connman_service_set_proxy_method' from 'check_proxy_method' to
set the service proxy method to 'CONNMAN_SERVICE_PROXY_METHOD_DIRECT'
when WPAD fails.
---
 src/service.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/service.c b/src/service.c
index 81a1bebdc14b..b3e45c95de46 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1470,8 +1470,7 @@  static bool check_proxy_setup(struct connman_service *service)
 		return true;
 
 	if (__connman_wpad_start(service) < 0) {
-		service->proxy = CONNMAN_SERVICE_PROXY_METHOD_DIRECT;
-		__connman_notifier_proxy_changed(service);
+		connman_service_set_proxy_method(service, CONNMAN_SERVICE_PROXY_METHOD_DIRECT);
 		return true;
 	}