From patchwork Mon Apr 15 16:27:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 48074 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:670b:b0:1a9:af23:56c1 with SMTP id wh11csp1953504pzb; Mon, 15 Apr 2024 09:28:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUjLNTPmoAs+wd0gYyOgV+YJL+c9sVwDYmjPWJYsMWhVCwIY9B3eYT/ADI9D1c/KVSPI1jUqwbgUDBvP+q8CVD2EhyKCOQ37hiiHQ== X-Google-Smtp-Source: AGHT+IFk69A3TLN0/xEJDRFK6mnCghqimmKnZQ+vYMjHZbwwMm2z3zbnMCH/hdw4O5RYWSwqAYvS X-Received: by 2002:a17:907:94d0:b0:a52:28f:5e61 with SMTP id dn16-20020a17090794d000b00a52028f5e61mr8981956ejc.27.1713198538708; Mon, 15 Apr 2024 09:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713198538; cv=none; d=google.com; s=arc-20160816; b=pORt44L9Tgy2BL0l6hZDN6CK2SB9gNwxmGHeoVvtx1a68naXAQCnfgy2zCfS2b/b5g UUfrSNhWrvrVWo2mFTaoz7aBj/KiYrdyJbW1bkW+3iPZlxm9e+6VDTE7LhUKVxvxtQ1+ iCEr+Kval+vgXT6nzve99p35qp66wZ7lEui5zS8tUBCmlGscaBD4KjXensUT8fEIEQ5M cpaDCM+xHzxhzu1WMTpu8wiN0SA+8PjMOZZeOasMkDubOsPiaCLFNIwPneooAZeCBtHX SOHJCA8GNduvhNdRvE0BFwWzFWvEBrboRNXYYF3eEFksPmVYAeYOkBGm19dvSgn+bq3f UTHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=gp+W5HGern95Kms76MKrSQ+TnHb9/ajmiRQu4UcoU3k=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=gC4W9eyHXXaNfuXzHx9QOMB5OyzpEQyBesqyKye3kuYqZjq3TYIGYo2YH2l7186ST0 dA+0wudgrW4ZoOlPSBs0nB33J7SGrF59SC4dlbIz+s4ZefmhVAN8Ik101YgpAHFBKDhF b1YBCbfcOCjXAUUY9JlPCwdpviW8tZxM9xzYkHyhGUFjJjdY6hvoRGxs0HH0okJec3nP +byYCKNdCOI6rt0Cz/d2pJKp8hes0l1hPM9EmoT2sY+ygg8ESOOVx0ClFVh4digZLQ6D SRViy4HK4b6RxQ0n63pi/1kTFRC8le8V1pAt5Tc2psRU4/Tcm2FraS2HQAU3YmH7suSP /gaQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=SPvjDs+w; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qw40-20020a1709066a2800b00a518fdd3dc1si4920081ejc.110.2024.04.15.09.28.57; Mon, 15 Apr 2024 09:28:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=SPvjDs+w; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 500ED68CFC8; Mon, 15 Apr 2024 19:28:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86FE268CD49 for ; Mon, 15 Apr 2024 19:28:04 +0300 (EEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4182353a15cso12115415e9.1 for ; Mon, 15 Apr 2024 09:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713198483; x=1713803283; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FhwQ9WqRnnPsqwZ/jKhnCQBxcORgCmjmOPvABXYH89w=; b=SPvjDs+wddSHu+L+ZUGg4dJanxl1qZNY3azyzm8BS4sEZRyISV0G/q+Qt6cek3CRdA ygvhZZCYghA9YGf67+zI+RA9FB8CxZdhZBsXlH7QFlYk/Id46wNqD9Gj478rgCHTHd4R FWeypFN1fV+GOPkdAQ1QM/3Ss0vaViP0uiJXMZl85Zc27PQvOq7ZpOWGvzP4+ButkRPS oQz7nhl7pBA912JMDfsaSCjN74M+TsN6juVYYPHK4k7F+oeVt9Tr2iR+VPEEvfVxoXQt I3uiL82K/cBI1L4EQd9D6RwMqSvBm04DOt7HTgJbYuQf7BWJm6wdevofaQnub9wWk2F9 kKvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713198483; x=1713803283; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FhwQ9WqRnnPsqwZ/jKhnCQBxcORgCmjmOPvABXYH89w=; b=teUEAKnRrSC5VoaqWkjHpHa//Rqh8GvpjHKu1O2ue8DV24RQ3RyoMcMT7HPK15BfBI dfR+OCLABpt2E85nQuCBlWCjSAXmVhfd436vxmQsJ1o+Az4Ct1Jtr++uUPX0GdF+CCzU sAN+z3Kkk4sWxnRLKZ99QFp2B8tCigoNj4PY2GcAYzyfpyXUM6vgdAZKBD8ZZ3flhSdr +PPdai+eGOq4QtulpJMGku0zMWyBpJ5hTau3+VCAcfyKxX4tiVrFu9wh66AlX5uaCfro l6bIFbiSTykcyIw0JPc6Q0AD2L6D8FMNPSdbgzDYrCx/OkTsaP7PLfgTC/lrTmLcQHQZ Nwfg== X-Gm-Message-State: AOJu0YzuZ/YII5TDRcpalBJYYLpXu8sAWWjyXLsKVUTadk4vBosYmLfD l2ehBzAY488H6FUhJVQ5Ru3uMmi05nXdOnp1+DBR7rvPcFEQsO/vcctsXA== X-Received: by 2002:a05:6000:4c:b0:33d:d7be:3bec with SMTP id k12-20020a056000004c00b0033dd7be3becmr8114318wrx.58.1713198483181; Mon, 15 Apr 2024 09:28:03 -0700 (PDT) Received: from localhost.localdomain (33bf3d9d.skybroadband.com. [51.191.61.157]) by smtp.gmail.com with ESMTPSA id u8-20020a5d4348000000b00347c187a3a0sm3899969wrr.24.2024.04.15.09.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:28:02 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 Apr 2024 17:27:40 +0100 Message-ID: <20240415162741.110374-6-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240415162741.110374-1-derek.buitenhuis@gmail.com> References: <20240415162741.110374-1-derek.buitenhuis@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/6] avformat/http: Rename attempts to auth_attempts X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 4gFmbhIN6B1m This accurately reflects what it does, as per e75bbcf493aeb549d04c56f49406aeee3950d93b. Signed-off-by: Derek Buitenhuis --- 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; }