From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id E5FA24E1A6 for ; Wed, 14 Jan 2026 02:29:19 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'YAbnFa0BFydq15I5sI+LJG1MYfeJWBSbLG7v0y/qW2Q=', expected b'mZ+0q7L6I+N303PJVSAYIe/HE4/KvS/5OcrbyZ82/8s=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1768357745; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=YAbnFa0BFydq15I5sI+LJG1MYfeJWBSbLG7v0y/qW2Q=; b=xozVHWmLzB+EJPpFMsnn0rIB6ncqgMr2Az5IQoazXv2PikGsGJl1CzzIyMWO1OGnXewJo 50TIDwqQUG/zagqpjTFVT6dCdZgN9tPobke5RVUVah9hKTVXmLyFScISomfbDZDFRaojyrZ +ymTqSp8gU4oMQZgyG2oMvzgIsRUqsABjRfmWFJQsCeqoBFUoyTNwkbVt2ZccaC5iISCu8K SHmgSFlpoD7eV16pl7ZfnC8uRpJOdGXPVqJnVZtBO6vr3hVrB5AkiSH/HNdJcelgXkvxNcX L62/IXcNB63yzt6Q2b9Ng5E2/K75lI5ja9RPE62Tx67gzml/Lm83FBpfCvng== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 47116690DFC; Wed, 14 Jan 2026 04:29:05 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1768357728; b=eZQwAhpuglNGMO7e7VJH9YRWfTQehCQ/feWKgeNCd2N2ZfmeqsD4YCw/NeBWK7hDVd5WE iR190qQk3YH+w7JXMWxFseOLDB2VQMllG0lOO37Jugr6LrjHoVKBQzQ3T46sUPT+ptrQzWU kduuMFv8wSRaHziIowir2D5NUMnwxI6jZFp7l30Z6YkXbSGgaGH19CvKQ39F2fZ6NRrCeb3 tL7qVzxFfvTBYUTC7CnVVQRZUVG43zkhKuOoAw3AF23O8onP3hPKOM+dUG4dwYiUDUilcpl zbduBAg9hBmp6UPfKMscOFJ4j4MFYiC6rgoWev/DF2c5oKhZEk0X8MuGg5cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1768357728; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=HWM1oA7EH9jbDV7rDiu9pwza0YFvyK3QpsHFL/klPh0=; b=tfNYAIzAykEKPp2LsVr00dOUuZnjeEBKWn6uSCu7Xjh1RO0MG1PYhYu/LTYnYCffaUshB 0895qSKjiZjjPMtMk8CyCmjHlMWgGGAigVgtLOcxGbOAFN24phcmxjHtg+XRvv0r8b+oRpI dxJcZxmU/7So+o8pN2VbolAxcj27WTxxiompZYsWzr9mBqS1wQVSIuyaSnpT7QqJun/qaKu RaoV2zyLXqwzVEc2PIZsa8cImAnOBrEOXRRn7nTs8hMTEzUgDT4GLKaYh97RFO9G/bhBUjo i6bojyDZi83vPj4FjED98rQsk0jx04X8gkUVMPyFhUNgWBxEb5Xi+znUvepQ== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1768357720; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=mZ+0q7L6I+N303PJVSAYIe/HE4/KvS/5OcrbyZ82/8s=; b=ZQl6fWOQ0aF9qiNaKSu9mtP60NJRcmd7TCe5VyRuh/8QvTlGYbdE6OKSByh/l7/rSBYH2 8nh1R2YK7YzjLg6pFr9bumBS8w8ewWMoDClZJtcRbYJapzdG+MpBiKHfIbX7LnhuThV9wUL 9zs0oPeuzDZvtDGo4Lytil3NpN7uxtkkD1YjqnSDJtlrewP4v1gUEAYPA2wPe0av5SQxMsj fgSDPdGZ9qEcvR+hO9+MZ/yslYYZNDyLuoGr7hWgQMRULDoo9D5JYllU6oc0IFZb2W7j51T POqsjL9VSVjoZZzYlz06iyI2e+zNRT8NUbFPw5r4f96qWaiPrn524CGx9pYQ== Received: from f7c34508609e (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id EC1D668D5DE for ; Wed, 14 Jan 2026 04:28:39 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Jan 2026 02:28:39 -0000 Message-ID: <176835772011.25.14296558730391462393@4457048688e7> Message-ID-Hash: T7VGD7ALVWS2CER2K6E6V3HRCXNU3ZYV X-Message-ID-Hash: T7VGD7ALVWS2CER2K6E6V3HRCXNU3ZYV X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] avformat/http: allow adjusting the redirect limit (PR #21458) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: michaelni via ffmpeg-devel Cc: michaelni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21458 opened by michaelni URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21458 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21458.patch Idea from: BapToutatis and also curl and wget have equivalent options Signed-off-by: Michael Niedermayer >>From 9dff008ed8c2a3ba73d9d1a23f1660501e20ed8e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 14 Jan 2026 03:21:46 +0100 Subject: [PATCH] avformat/http: allow adjusting the redirect limit Idea from: BapToutatis and also curl and wget have equivalent options Signed-off-by: Michael Niedermayer --- libavformat/http.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index bd25a45636..cb1bd6bc20 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -146,6 +146,7 @@ typedef struct HTTPContext { unsigned int retry_after; int reconnect_max_retries; int reconnect_delay_total_max; + int max_redirects; } HTTPContext; #define OFFSET(x) offsetof(HTTPContext, x) @@ -191,6 +192,7 @@ static const AVOption options[] = { { "resource", "The resource requested by a client", OFFSET(resource), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, { "reply_code", "The http status code to return to a client", OFFSET(reply_code), AV_OPT_TYPE_INT, { .i64 = 200}, INT_MIN, 599, E}, { "short_seek_size", "Threshold to favor readahead over seek.", OFFSET(short_seek_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D }, + { "max_redirects", "Maximum number of redirects", OFFSET(max_redirects), AV_OPT_TYPE_INT, { .i64 = MAX_REDIRECTS }, 0, INT_MAX, D }, { NULL } }; @@ -384,6 +386,9 @@ redo: cached = redirect_cache_get(s); if (cached) { + if (redirects++ >= s->max_redirects) + return AVERROR(EIO); + av_free(s->location); s->location = av_strdup(cached); if (!s->location) { @@ -452,7 +457,7 @@ redo: s->new_location) { /* url moved, get next */ ffurl_closep(&s->hd); - if (redirects++ >= MAX_REDIRECTS) + if (redirects++ >= s->max_redirects) return AVERROR(EIO); if (!s->expires) { -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org