[PATCH 3/7] service: Refactor 'connman_service_set_proxy_method'.
Grant Erickson <[email protected]> Tue, 4 Mar 2025 13:03:01 -0800
| Newsgroups | dev.linux.lists.connman |
|---|---|
| Message-ID | <44b13e5a6dacb06960ed0480ffc598e19b21f8a8.1741121901.git.gerickson@nuovations.com> |
There are currently two places where the network service proxy method
is set:
1. connman_service_set_proxy_method
2. __connman_service_set_proxy_autoconfig
Prior to this change, each did a similar, but bespoke set of
operations to set the network service proxy method.
Leverage 'service_set_proxy_method', which embodies the
previously-similar, bespoke operations, for
'connman_service_set_proxy_method', the first of the above two call
sites.
---
src/service.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/service.c b/src/service.c
index db6ec26240fd..6fff20d4de96 100644
--- a/src/service.c
+++ b/src/service.c
@@ -5618,19 +5618,13 @@ static void service_set_proxy_method(struct connman_service *service,
void connman_service_set_proxy_method(struct connman_service *service,
enum connman_service_proxy_method method)
{
- DBG("service %p (%s) method %d (%s)",
- service, connman_service_get_identifier(service),
- method, proxymethod2string(method));
-
- if (!service || service->hidden)
- return;
-
- service->proxy = method;
-
- proxy_changed(service);
+ const bool donotifier = method != CONNMAN_SERVICE_PROXY_METHOD_AUTO;
- if (method != CONNMAN_SERVICE_PROXY_METHOD_AUTO)
- __connman_notifier_proxy_changed(service);
+ service_set_proxy_method(service,
+ method,
+ donotifier,
+ NULL,
+ NULL);
}
enum connman_service_proxy_method connman_service_get_proxy_method(
--
2.45.0