From patchwork Mon Apr 15 16:43:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 48076 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:670b:b0:1a9:af23:56c1 with SMTP id wh11csp1962873pzb; Mon, 15 Apr 2024 09:43:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXaI5vdn6dHDTpYRLi++lQlxRc6yBggSgivhO1MSRpN3228K2zRq+p9cY/33NL3JSO1Ti2eLSexvY/FfEd37h9Mde/laKDY0fjvzw== X-Google-Smtp-Source: AGHT+IFxrNXc5O8J3pkUOCOgZmOqJhKGlMF795BBrgr/nUZab7xBcmVDdls0JfEVDVj8gVidE0R+ X-Received: by 2002:a17:906:4549:b0:a55:358f:e497 with SMTP id s9-20020a170906454900b00a55358fe497mr199313ejq.18.1713199426002; Mon, 15 Apr 2024 09:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713199425; cv=none; d=google.com; s=arc-20160816; b=YUj/m7yIo/ZyxiaAItNwJyYAQCtqJuCzW99bGXXdHP6HS+6/XUhoz2fytQzb6b7ih0 +kVeriF/8lKPOTKrtTc4+3aB7O0O/UJL1GhzlTVwQ7fEdXQ3CASdOJsp8V++OPsVvTx2 HpBbqfvGZhFgXt/rYNZKXoOBEqprGgp+iSNwKVyhGBK1o1l1ctNGIK1+72BgP5irPYPS 3B0aJA8xaIHf58xzIgU+1Xq3erugswC0VY7ioA2OvS/V3V+rSe8IZbyPZFD1AqK+5rYD JnqR0LPOfOCecruaD2L3MH7kQm75U1wF4NSD5/jWDF9B0K7ONnHi62N6G0+lF9YRYfiX 8kiw== 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=4JDIbqu9XK1HZyr3FeMOGfmFdR/caV8HtX7nc0C0IvM=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=XK/2+p2+eNIY2YvcXQkrgV4P4yNl6Ec20PRPp4+liwZCjL3+0lO2qF6Et0XZDOSssW 5g78rgj4lpDpFLP2gsx6A0afwCTzcQKunyQUb+WGLFjkMS/fjTPRpN9TmeFGQBzPpeAA eEHP0f9Tuoh5fKNBOiUC3Pcfvt5zhJVlp3wWErDXj55wxB0MlOefx+KNLSwBRT/HeO9C zk1FdUozm8Bt0PV2KIU89gH5409VhgbqwVV+3vDlqJJVsomVbvZHtZvX6VgoKYuQDmxj ZPUlrMdDOB/uIDo9DJk2EiF58tO95QfaVWr/s4WF8VVlJTlqNxa23tWy/wSW9PA+OQlv lwGg==; 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=VEDsP1Xg; 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 o23-20020a170906601700b00a526d2a5aabsi939105ejj.708.2024.04.15.09.43.45; Mon, 15 Apr 2024 09:43:45 -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=VEDsP1Xg; 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 C947868C2DF; Mon, 15 Apr 2024 19:43:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA10C68C2DF for ; Mon, 15 Apr 2024 19:43:35 +0300 (EEST) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-344047ac7e4so2628893f8f.0 for ; Mon, 15 Apr 2024 09:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713199415; x=1713804215; 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=cB8fzgGV/3FJeWzJVVfhIte6zThqHL99BezwSNSPkJc=; b=VEDsP1XgC6+nusxZaVb20UL8JM31VGjckyLmAylcgjUXXHC7+D22OWI5gD/chihFbS FDIAX6rahxLaauWVyBV6GHTc++OVYGob+4etElbx/7bSwyYSzXhL6WhlV1Qum5+o/U48 QwwyOPwdAYOu+fg/ZmHgMe0FJ/VNrnvDqC3hV38GG6n1rUNT14Ppr/8z4OFfg9XlLz3C B1HDunmMBt7EPJTeprPoMOO9mKxGX3v71GLrlIEXPNN26YQN0odI2RytHi6wyyb0cMdQ mhfmzAaCaEcw74qTZ5GbZDa3bJJlgNGeeZzteSDdJD26OAIO68OpMb2qzRfpjkgiG5rp iasg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713199415; x=1713804215; 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=cB8fzgGV/3FJeWzJVVfhIte6zThqHL99BezwSNSPkJc=; b=udBIcGfoH6VYaaN1abshhFfryD9FYTbZg2NDl/FZQ3kL46Setvevn8gxjx+TO+o9E/ pyLR8XP2+yWmoRfs11NoYV8+zKnssglxaQ36Sm+rob6hlthMRYs6USuoXMDvLfLw/vgT ViF/bvJabk2U/5xkjskmYveKq18U14QGcqRvLe5KsdEomhqt1EBC2JEUIKUMCzyFd0WY gddRqkL+3SHEe/i1KFc0N3Ta4FcAPnuzPD3J8okjjkMMNR+YAiD5aMnyddCHHYHLVZ7v TPuhadxDe46DCP4AiagpFEQmQdBwpGtwgEuIRuCRfoKpy6bGSB17KK3HYMffQJLM/mov NdkQ== X-Gm-Message-State: AOJu0YzuN2cTZgRuIsyYmJX8lCLi9lvY5P46kvoXvBiTTWrM+U5QNBpJ vtLAxrxnx44iLRK7KeWCoO3wzeyW67B7v4O58ayLAF7xfy27hy7rDV8PjQ== X-Received: by 2002:adf:edcf:0:b0:343:d7fe:96f8 with SMTP id v15-20020adfedcf000000b00343d7fe96f8mr187363wro.19.1713199414734; Mon, 15 Apr 2024 09:43:34 -0700 (PDT) Received: from localhost.localdomain (33bf3d9d.skybroadband.com. [51.191.61.157]) by smtp.gmail.com with ESMTPSA id l35-20020a05600c1d2300b004161af729f4sm17159032wms.31.2024.04.15.09.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:43:34 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 Apr 2024 17:43:17 +0100 Message-ID: <20240415164317.110580-1-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 1/6] avutil/error: Add HTTP 429 Too Many Requests AVERROR code 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: 6nikjS+7CrKx This is a common error code from e.g. CDNs or cloud storage, and it is useful to be able to handle it differently to a generic 4XX code. Its source is RFC6585. Signed-off-by: Derek Buitenhuis --- libavutil/error.c | 1 + libavutil/error.h | 1 + libavutil/version.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavutil/error.c b/libavutil/error.c index 938a8bc000..7a9d760e76 100644 --- a/libavutil/error.c +++ b/libavutil/error.c @@ -61,6 +61,7 @@ static const struct error_entry error_entries[] = { { ERROR_TAG(HTTP_UNAUTHORIZED), "Server returned 401 Unauthorized (authorization failed)" }, { ERROR_TAG(HTTP_FORBIDDEN), "Server returned 403 Forbidden (access denied)" }, { ERROR_TAG(HTTP_NOT_FOUND), "Server returned 404 Not Found" }, + { ERROR_TAG(HTTP_TOO_MANY_REQUESTS), "Server returned 404 Too Many Requests" }, { ERROR_TAG(HTTP_OTHER_4XX), "Server returned 4XX Client Error, but not one of 40{0,1,3,4}" }, { ERROR_TAG(HTTP_SERVER_ERROR), "Server returned 5XX Server Error reply" }, #if !HAVE_STRERROR_R diff --git a/libavutil/error.h b/libavutil/error.h index 0d3269aa6d..1efa86c4c1 100644 --- a/libavutil/error.h +++ b/libavutil/error.h @@ -79,6 +79,7 @@ #define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8,'4','0','1') #define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8,'4','0','3') #define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8,'4','0','4') +#define AVERROR_HTTP_TOO_MANY_REQUESTS FFERRTAG(0xF8,'4','2','9') #define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8,'4','X','X') #define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8,'5','X','X') diff --git a/libavutil/version.h b/libavutil/version.h index 1f2bddc022..5de2d92146 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -80,7 +80,7 @@ #define LIBAVUTIL_VERSION_MAJOR 59 #define LIBAVUTIL_VERSION_MINOR 15 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \