From 499ad54d982307a31ef70f6256a9ffccff0057e5 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 12 Mar 2012 14:03:46 +0200 Subject: http: Clear the auth state on redirects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently we only try continuing with the same auth mechanism as the initial request. Signed-off-by: Martin Storsjö --- libavformat/http.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/http.c b/libavformat/http.c index a768b19fd9..c69e3f5055 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -168,6 +168,9 @@ static int http_open_cnx(URLContext *h) ffurl_close(hd); if (redirects++ >= MAX_REDIRECTS) return AVERROR(EIO); + /* 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; location_changed = 0; goto redo; -- cgit v1.2.3