# [PATCH 6/6] http: rename HTTP_REAUTH to HTTP_AUTH_RETRY

2 messages from 2012-05-03 to 2012-05-04. Participants: Nelson Benitez Leon, Jeff King.
Thread: https://gitlist.dev/t/30411

## Nelson Benitez Leon, 2012-05-03 16:40

Subject: [PATCH 6/6] http: rename HTTP_REAUTH to HTTP_AUTH_RETRY
Message-ID: <4FA2B508.8000702@seap.minhap.es>
URL: https://gitlist.dev/e/4FA2B508.8000702%40seap.minhap.es

```
After adding the proxy authentication support in http, the semantics
of HTTP_REAUTH changed more to a retry rather than a re-authentication,
so we rename it to HTTP_AUTH_RETRY.

Signed-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 http.c |    6 +++---
 http.h |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/http.c b/http.c
index 1468ec7..ba07e12 100644
--- a/http.c
+++ b/http.c
@@ -877,7 +877,7 @@ static int http_request(const char *url, void *result, int target, int options)
 			} else {
 				credential_fill(&http_auth);
 				init_curl_http_auth(slot->curl);
-				ret = HTTP_REAUTH;
+				ret = HTTP_AUTH_RETRY;
 			}
 		} else if (results.http_code == 407) { /* Proxy authentication failure */
 			if (proxy_auth.username && proxy_auth.password) {
@@ -886,7 +886,7 @@ static int http_request(const char *url, void *result, int target, int options)
 			} else {
 				credential_fill(&proxy_auth);
 				set_proxy_auth(slot->curl);
-				ret = HTTP_REAUTH;
+				ret = HTTP_AUTH_RETRY;
 			}
 		} else {
 			if (!curl_errorstr[0])
@@ -916,7 +916,7 @@ static int http_request_reauth(const char *url, void *result, int target,
 
 	do {
 		ret = http_request(url, result, target, options);
-	} while (ret == HTTP_REAUTH);
+	} while (ret == HTTP_AUTH_RETRY);
 
 	return ret;
 }
diff --git a/http.h b/http.h
index 483e3ed..4bfa267 100644
--- a/http.h
+++ b/http.h
@@ -123,7 +123,7 @@ extern char *get_remote_object_url(const char *url, const char *hex,
 #define HTTP_MISSING_TARGET	1
 #define HTTP_ERROR		2
 #define HTTP_START_FAILED	3
-#define HTTP_REAUTH	4
+#define HTTP_AUTH_RETRY	4
 #define HTTP_NOAUTH	5
 
 /*
-- 
1.7.7.6

```

## Jeff King, 2012-05-04 07:25

Subject: Re: [PATCH 6/6] http: rename HTTP_REAUTH to HTTP_AUTH_RETRY
Message-ID: <20120504072556.GF21895@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20120504072556.GF21895%40sigill.intra.peff.net
In-Reply-To: <4FA2B508.8000702@seap.minhap.es>

```
On Thu, May 03, 2012 at 06:40:40PM +0200, Nelson Benitez Leon wrote:

> After adding the proxy authentication support in http, the semantics
> of HTTP_REAUTH changed more to a retry rather than a re-authentication,
> so we rename it to HTTP_AUTH_RETRY.

The patch looks fine, but a minor nit on the rationale. It has nothing
to do with the proxy auth. It has always been a bad name. It is not "you
should re-authenticate", but rather "I have already re-authenticated,
and therefore you should call me again to retry".

-Peff

```
