ConnMan network manager
 help / color / mirror / Atom feed
From: Grant Erickson <gerickson@nuovations.com>
To: connman@lists.linux.dev
Subject: [PATCH] service: Leverage 'connman_service_set_proxy_method'.
Date: Wed, 15 Nov 2023 20:54:04 -0800	[thread overview]
Message-ID: <20231116045404.638187-1-gerickson@nuovations.com> (raw)

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 --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;
 	}
 
-- 
2.42.0


             reply	other threads:[~2023-11-16  4:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16  4:54 Grant Erickson [this message]
2023-11-16  4:59 ` [PATCH v2] service: Leverage 'connman_service_set_proxy_method' Grant Erickson
2023-11-23 11:22   ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231116045404.638187-1-gerickson@nuovations.com \
    --to=gerickson@nuovations.com \
    --cc=connman@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).