Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 5/6] avformat/http: Rename attempts to auth_attempts
Date: Mon, 15 Apr 2024 17:27:40 +0100
Message-ID: <20240415162741.110374-6-derek.buitenhuis@gmail.com> (raw)
In-Reply-To: <20240415162741.110374-1-derek.buitenhuis@gmail.com>

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

diff --git a/libavformat/http.c b/libavformat/http.c
index 8f092f108d..ce1af5f976 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -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;
     }
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2024-04-15 16:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 16:27 [FFmpeg-devel] [PATCH 0/6] HTTP rate limiting and retry improvements Derek Buitenhuis
2024-04-15 16:27 ` [FFmpeg-devel] [PATCH 1/6] avutil/error: Add HTTP 429 Too Many Requests AVERROR code Derek Buitenhuis
2024-04-15 16:31   ` Andreas Rheinhardt
2024-04-15 16:43     ` Derek Buitenhuis
2024-04-15 16:27 ` [FFmpeg-devel] [PATCH 2/6] avformat/http: Use AVERROR_HTTP_TOO_MANY_REQUESTS Derek Buitenhuis
2024-04-15 16:27 ` [FFmpeg-devel] [PATCH 3/6] avformat/http: Don't bail on parsing headers on "bad" HTTP codes Derek Buitenhuis
2024-04-15 16:27 ` [FFmpeg-devel] [PATCH 4/6] avformat/http: Add support for Retry-After header Derek Buitenhuis
2024-04-15 16:35   ` James Almer
2024-04-15 16:49     ` Derek Buitenhuis
2024-04-15 16:27 ` Derek Buitenhuis [this message]
2024-04-15 16:27 ` [FFmpeg-devel] [PATCH 6/6] avformat/http: Add options to set the max number of connection retries Derek Buitenhuis
2024-04-15 16:43 ` [FFmpeg-devel] [PATCH 1/6] avutil/error: Add HTTP 429 Too Many Requests AVERROR code Derek Buitenhuis
2024-04-15 16:44   ` Derek Buitenhuis
2024-04-15 16:49 ` [FFmpeg-devel] [PATCH 4/6 v2] avformat/http: Add support for Retry-After header Derek Buitenhuis
2024-04-15 17:33   ` Stefano Sabatini
2024-04-16 13:59     ` Derek Buitenhuis
2024-04-16 13:55 ` [FFmpeg-devel] [PATCH 7/6] doc/protocols: Re-order HTTP options to match http.c order Derek Buitenhuis
2024-04-16 13:55   ` [FFmpeg-devel] [PATCH 8/6] doc/protocols: Fill in missing HTTP options Derek Buitenhuis
2024-04-16 17:13     ` Stefano Sabatini
2024-04-22 14:26       ` Derek Buitenhuis
2024-04-22 14:58         ` Stefano Sabatini
2024-04-16 17:08   ` [FFmpeg-devel] [PATCH 7/6] doc/protocols: Re-order HTTP options to match http.c order Stefano Sabatini

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=20240415162741.110374-6-derek.buitenhuis@gmail.com \
    --to=derek.buitenhuis@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.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

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git