From patchwork Mon Apr 22 14:25:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 48220 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c906:b0:1a9:af23:56c1 with SMTP id gx6csp2325822pzb; Mon, 22 Apr 2024 07:27:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU7z8yF4GFCW6nGovNmzgUaC3a30HRLnXb4L+YRBsnTtkEtLd8y5dC6eIYU+igCiUBH1qk9pNkXdcDCqIoMadjv09wwcneag6KKvA== X-Google-Smtp-Source: AGHT+IFNpfw5kZcKjrI3O/d+/UB9eXuqh+LAaZ4LwlIvQ0x9ru/skrZYLrvwmIWjkzIH47zf2zT2 X-Received: by 2002:a2e:86d3:0:b0:2d4:514b:428 with SMTP id n19-20020a2e86d3000000b002d4514b0428mr6244171ljj.6.1713796033647; Mon, 22 Apr 2024 07:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713796033; cv=none; d=google.com; s=arc-20160816; b=sEWOKw5J0L/e0HOJ1oUVQ3otywJUw4b8HurXN1XOinKsMHuwZjrzModB3ERC7A3lRH 5YDRTXVAXM43gntRjBc4cS+bxmND3tSCapIrFIUPn+JNEiVChzY+lZMzDM9s2UFLCYmT zAfzj1WLw2w7foQIbapN/CJlLrAdehhhqf6rkfXzL3/5qGwSWBfXoT0kepPiiUvwsOxk iPfcdjXMilnepf/eiRAQCuALQyRlUTbBLCUoDf0CRlHu2oZN2IFxJhJL3X/CnIkSH6Fw 769Ij16T1fLHzOgH9sIIRJzHgI5EExHnaAdl7yDZEf739FENfgkP7pz3J5VJIP5jSWL4 K6Gg== 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=VmhkffvjzDrHpIN0UH1GMHVw0GRRdKZOT85o+1whPak=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=OubAWlnPA/dDF0htmagN45tljiijNBZLUk4lYrDLf/5Xufdna8KFCB7LqYHOf/BFJL wc8nZrLPSVM6iGnC1CX7rnOSNW0DbhXEZzV10izcD/kdldZ4SJAkBczXh+86VXyiTFXW 6dFbCXpK7YHs+39FWZN407XbkmgUUDHXUYUv06XqJFCmGxXKevXrssjjrTzURJqIzntb 5SdW+9xNSnIwNbQHz7DFTcu1n1WpMxGg8uHoHpdsWRh8hKQj8ifunuYAQYArmf8f1tWO l4aGSaePBlnAQmg0O2ZwU+5h4rcR+GgkkyNROllAf0i6pKXevfFMZqW4GqlI8oVq+aRS VOmg==; 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=hX9Flob3; 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 a11-20020a2eb16b000000b002d9080a62eesi2825938ljm.66.2024.04.22.07.27.13; Mon, 22 Apr 2024 07:27:13 -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=hX9Flob3; 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 BE30A68D370; Mon, 22 Apr 2024 17:26:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C01D68D2D6 for ; Mon, 22 Apr 2024 17:26:04 +0300 (EEST) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-41a74e60753so5796795e9.1 for ; Mon, 22 Apr 2024 07:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713795963; x=1714400763; 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=Ms19ve/5z5HPAfTLKU7FFo5PSrNOm3Dkh5NnotI6Rtk=; b=hX9Flob3s3YQr3tBBDDPmyen9Y/UUusHkZ+YXQOwZk2XKSHjtO7daEVesjysgMxih2 wNG0x9s3yVNmDXTlSFvX4tq0esLVPw8noZqHGT9ZIt0sQUC3UqpRixzf6nvnoZ8Dxt5T yQp/WMF1thnbww0Hd07EhmkuKtBGksNbQk5zv6Asg2aUKOUECjvOKQhDJILU/EACt4Ih RqRamnBv9p0MI0cCO00JHnHqv/5IMLodK0AaXc5WoAHWsCRtujTHClm4T4dbzAxMUHJa we/xzPnjJy932VjiUrosjvZd5RcudUyW63sIwz9OTMpizZakk6ll4nZ3kULMBSZD20KT 9raQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713795963; x=1714400763; 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=Ms19ve/5z5HPAfTLKU7FFo5PSrNOm3Dkh5NnotI6Rtk=; b=O2q2qnj1p8EZrZnzdr5RqGwAXgDD8DDkShXeyNI1CNwr5JhQILlZPIou3iUsTKu3t5 mEg45CJACCC1iHTq7aaoIQc02JDXj+LUYP706TKyjj+J9rHZn28sXyoE+TT/cLM+KL4Q tSPzCQXZSX69fvLLW8fK2Yq/rIe1plQi4EtnSX6HqvU8xbSuMvwkISfmma194ERDuTGz flPGN8ps8LOhpza2hO7JFF9Ck7NSZxf9migD914/i2f426gZ2YpXv0nJSJx0OF/X7UWe DKds96HdIpLjUQn9noqi0A0ZsMZMtB7gQE3xVRgYURApPvrV2vUu2/PT20IwYmSsTavv 3yaA== X-Gm-Message-State: AOJu0Yz4Up8QdGQWghIsCV1y76czvECdn9aX3bLncwQTq61g30O6gct9 NzWicEXSDiBCV+bnyzJbRTgBKla50LnESKF/hHmPOY/Fvp+nxEls3CNWEA== X-Received: by 2002:a05:600c:4508:b0:418:a17e:cb47 with SMTP id t8-20020a05600c450800b00418a17ecb47mr7189315wmo.10.1713795962965; Mon, 22 Apr 2024 07:26:02 -0700 (PDT) Received: from localhost.localdomain (33bf3d9d.skybroadband.com. [51.191.61.157]) by smtp.gmail.com with ESMTPSA id d11-20020a05600c3acb00b0041aa14b4646sm67111wms.8.2024.04.22.07.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 07:26:01 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Apr 2024 15:25:43 +0100 Message-ID: <20240422142547.281064-6-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240422142547.281064-1-derek.buitenhuis@gmail.com> References: <20240422142547.281064-1-derek.buitenhuis@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 5/9] 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: 1BWGEAduXfNC 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 5ed481b63a..6927fea2fb 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; }