@@ -359,7 +359,7 @@ static int http_open_cnx(URLContext *h, AVDictionary **options)
{
HTTPAuthType cur_auth_type, cur_proxy_auth_type;
HTTPContext *s = h->priv_data;
- int ret, attempts = 0, redirects = 0;
+ int ret, auth_attempts = 0, redirects = 0;
int reconnect_delay = 0;
uint64_t off;
char *cached;
@@ -409,10 +409,10 @@ redo:
goto redo;
}
- attempts++;
+ auth_attempts++;
if (s->http_code == 401) {
if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
- s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
+ s->auth_state.auth_type != HTTP_AUTH_NONE && auth_attempts < 4) {
ffurl_closep(&s->hd);
goto redo;
} else
@@ -420,7 +420,7 @@ redo:
}
if (s->http_code == 407) {
if ((cur_proxy_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
- s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
+ s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && auth_attempts < 4) {
ffurl_closep(&s->hd);
goto redo;
} else
@@ -449,7 +449,7 @@ redo:
/* Restart the authentication process with the new target, which
* might use a different auth mechanism. */
memset(&s->auth_state, 0, sizeof(s->auth_state));
- attempts = 0;
+ auth_attempts = 0;
goto redo;
}
return 0;
@@ -2082,7 +2082,7 @@ static int http_proxy_open(URLContext *h, const char *uri, int flags)
char hostname[1024], hoststr[1024];
char auth[1024], pathbuf[1024], *path;
char lower_url[100];
- int port, ret = 0, attempts = 0;
+ int port, ret = 0, auth_attempts = 0;
HTTPAuthType cur_auth_type;
char *authstr;
@@ -2142,10 +2142,10 @@ redo:
if (ret < 0)
goto fail;
- attempts++;
+ auth_attempts++;
if (s->http_code == 407 &&
(cur_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
- s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 2) {
+ s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && auth_attempts < 2) {
ffurl_closep(&s->hd);
goto redo;
}
This accurately reflects what it does, as per e75bbcf493aeb549d04c56f49406aeee3950d93b. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> --- libavformat/http.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)