http: Clear the auth state on redirects
authorMartin Storsjö <martin@martin.st>
Mon, 12 Mar 2012 12:03:46 +0000 (14:03 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 13 Mar 2012 09:19:29 +0000 (11:19 +0200)
Currently we only try continuing with the same auth mechanism
as the initial request.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/http.c

index a768b19..c69e3f5 100644 (file)
@@ -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;