git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Simon.Richter@hogyros.de
To: git@vger.kernel.org
Cc: Simon Richter <Simon.Richter@hogyros.de>
Subject: [PATCH 1/3] Rename proxy_authmethods -> authmethods
Date: Fri, 13 May 2022 09:04:14 +0200	[thread overview]
Message-ID: <20220513070416.37235-2-Simon.Richter@hogyros.de> (raw)
In-Reply-To: <20220513070416.37235-1-Simon.Richter@hogyros.de>

From: Simon Richter <Simon.Richter@hogyros.de>

Curl also allows specifying a list of acceptable auth methods for the
request itself, so this isn't specific to proxy authentication.

Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
 http.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/http.c b/http.c
index 229da4d148..318dc5daea 100644
--- a/http.c
+++ b/http.c
@@ -79,7 +79,7 @@ static int proxy_ssl_cert_password_required;
 static struct {
 	const char *name;
 	long curlauth_param;
-} proxy_authmethods[] = {
+} authmethods[] = {
 	{ "basic", CURLAUTH_BASIC },
 	{ "digest", CURLAUTH_DIGEST },
 	{ "negotiate", CURLAUTH_GSSNEGOTIATE },
@@ -470,14 +470,14 @@ static void init_curl_proxy_auth(CURL *result)
 
 	if (http_proxy_authmethod) {
 		int i;
-		for (i = 0; i < ARRAY_SIZE(proxy_authmethods); i++) {
-			if (!strcmp(http_proxy_authmethod, proxy_authmethods[i].name)) {
+		for (i = 0; i < ARRAY_SIZE(authmethods); i++) {
+			if (!strcmp(http_proxy_authmethod, authmethods[i].name)) {
 				curl_easy_setopt(result, CURLOPT_PROXYAUTH,
-						proxy_authmethods[i].curlauth_param);
+						authmethods[i].curlauth_param);
 				break;
 			}
 		}
-		if (i == ARRAY_SIZE(proxy_authmethods)) {
+		if (i == ARRAY_SIZE(authmethods)) {
 			warning("unsupported proxy authentication method %s: using anyauth",
 					http_proxy_authmethod);
 			curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
-- 
2.30.2


  reply	other threads:[~2022-05-13  7:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13  7:04 [PATCH 0/3] Allow configuration of HTTP authentication method Simon.Richter
2022-05-13  7:04 ` Simon.Richter [this message]
2022-05-13 19:50   ` [PATCH 1/3] Rename proxy_authmethods -> authmethods Junio C Hamano
2022-05-13  7:04 ` [PATCH 2/3] Add config option/env var to limit HTTP auth methods Simon.Richter
2022-05-13 20:26   ` Junio C Hamano
2022-05-13  7:04 ` [RFC PATCH 3/3] Allow empty user name in HTTP authentication Simon.Richter
2022-05-13 23:51   ` brian m. carlson

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20220513070416.37235-2-Simon.Richter@hogyros.de \
    --to=simon.richter@hogyros.de \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).