This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 3c1b99d8df8ea9468f3b5347a132890f8b2cab9d Author: Niklas Haas <[email protected]> AuthorDate: Thu Jul 9 16:45:58 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Thu Sep 3 19:05:28 2026 +0000 avformat/libcurl: log number of errors, not retries This is arguably more informative, and also easier to account for, than the retries (which are already indirectly reflected in the number of requests and connections). More importantly, this avoids getting in the way of us refactoring the retry mechanism. Sponsored-by: nxtedition AB Signed-off-by: Niklas Haas <[email protected]> --- libavformat/libcurl.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavformat/libcurl.c b/libavformat/libcurl.c index dcd7d291fc..90d4c27708 100644 --- a/libavformat/libcurl.c +++ b/libavformat/libcurl.c @@ -87,7 +87,7 @@ typedef struct CurlLoop { int num_connections; int num_redirects; int num_requests; - int num_retries; + int num_errors; } CurlLoop; struct CurlContext { @@ -307,6 +307,7 @@ static size_t header_callback(char *ptr, size_t size, size_t nitems, void *userd av_log(c->h, AV_LOG_ERROR, "Server sent back unexpected reply " "with offset %"PRId64" (expected %"PRId64")\n", content_start, c->request_start); + c->loop->num_errors++; c->stream_ok = 0; if (!c->status) c->status = AVERROR(EIO); @@ -358,6 +359,7 @@ static size_t header_callback(char *ptr, size_t size, size_t nitems, void *userd if (c->seekable_opt >= 0) c->seekable = c->seekable_opt; } else { + c->loop->num_errors++; c->stream_ok = 0; if (!c->status) c->status = ff_http_averror(status, AVERROR(EIO)); @@ -476,6 +478,7 @@ static void on_done(CurlContext *c, CURLcode code) c->stream_ok = 0; if (!c->status) c->status = curlcode_to_averror(code); + c->loop->num_errors++; pthread_cond_broadcast(&c->cond); pthread_mutex_unlock(&c->mutex); return; @@ -501,14 +504,15 @@ static void on_done(CurlContext *c, CURLcode code) return; } - if (c->stream_ok) + if (c->stream_ok) { av_log(c->h, AV_LOG_WARNING, "%s\n", curl_easy_strerror(code)); + c->loop->num_errors++; + } /* Resume seekable transfers after a recoverable error. */ if (c->seekable && is_recoverable(code) && c->retry_count < c->max_retries) { c->retry_count++; - c->loop->num_retries++; av_log(c->h, AV_LOG_WARNING, "Retrying (#%d) from %"PRId64"\n", c->retry_count, c->request_start); start_request(c); @@ -712,8 +716,8 @@ static void print_statistics(CurlLoop *loop) loop->total_bytes, time * 1e3, avg / 1e3); av_log(avfc, AV_LOG_VERBOSE, - "libcurl: %d connections, %d redirects, %d requests, %d retries\n", - loop->num_connections, loop->num_redirects, loop->num_requests, loop->num_retries); + "libcurl: %d connections, %d redirects, %d requests, %d errors\n", + loop->num_connections, loop->num_redirects, loop->num_requests, loop->num_errors); } static void curl_loop_destroy(CurlLoop *loop) -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
