[libav-stable] http: Fix authentication, broken since 6a463e7fb

Martin Storsjö git at libav.org
Wed Aug 13 19:22:46 CEST 2014


Module: libav
Branch: master
Commit: 4e629ef80e62a54636cb46033998177dd08cf3ad

Author:    Martin Storsjö <martin at martin.st>
Committer: Martin Storsjö <martin at martin.st>
Date:      Wed Aug 13 14:32:52 2014 +0300

http: Fix authentication, broken since 6a463e7fb

The cur_*auth_type variables were set before the http_connect call
prior to 6a463e7fb - their sole purpose is to record the
authentication type used to do the latest request, since parsing
the http response sets the new type in the auth state.

CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>

---

 libavformat/http.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 98f41c0..377d30e 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -201,14 +201,14 @@ static int http_open_cnx(URLContext *h, AVDictionary **options)
     HTTPContext *s = h->priv_data;
     int location_changed, attempts = 0, redirects = 0;
 redo:
+    cur_auth_type       = s->auth_state.auth_type;
+    cur_proxy_auth_type = s->auth_state.auth_type;
+
     location_changed = http_open_cnx_internal(h, options);
     if (location_changed < 0)
         goto fail;
 
     attempts++;
-    cur_auth_type       = s->auth_state.auth_type;
-    cur_proxy_auth_type = s->auth_state.auth_type;
-
     if (s->http_code == 401) {
         if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
             s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {



More information about the libav-stable mailing list