Commit 332ead500a for ffmpeg
commit 332ead500ad064c3582e878958308a8b6abdabe9
Author: Kacper Michajłow <kasper93@gmail.com>
Date: Thu Oct 1 06:44:11 2026 +0200
avformat/http: clear the status code before each request
A request that fails before its reply arrives, such as a TLS connection
through a proxy that refuses the tunnel, no longer carries the status of
the previous reply.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
diff --git a/libavformat/http.c b/libavformat/http.c
index b7ae56f723..8ab144079c 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -459,6 +459,7 @@ redo:
cur_proxy_auth_type = s->auth_state.auth_type;
off = s->off;
+ s->http_code = 0;
ret = http_open_cnx_internal(h, options);
if (ret < 0) {
if (!http_should_reconnect(s, ret) ||
@@ -1690,8 +1691,7 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
* WWW-Authenticate header, or an 100 continue if no auth actually
* is needed. */
if (auth && *auth &&
- s->auth_state.auth_type == HTTP_AUTH_NONE &&
- s->http_code != 401)
+ s->auth_state.auth_type == HTTP_AUTH_NONE)
send_expect_100 = 1;
}
}