History

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.

Martin Storsjö committed 12 years ago

Commit 4e629ef1 parent db68ef81 file · +3 −3Browse files

Unified · Split

libavformat/http.c+3−3
@@ -201,14 +201,14 @@ static int http_open_cnx(URLContext *h, AVDictionary **options) · 200 unmodified lines
201201 HTTPContext *s = h->priv_data;
202202 int location_changed, attempts = 0, redirects = 0;
203203 redo:
204+ cur_auth_type = s->auth_state.auth_type;
205+ cur_proxy_auth_type = s->auth_state.auth_type;
206+
204207 location_changed = http_open_cnx_internal(h, options);
205208 if (location_changed < 0)
206209 goto fail;
207210
208211 attempts++;
209− cur_auth_type = s->auth_state.auth_type;
210− cur_proxy_auth_type = s->auth_state.auth_type;
211−
212212 if (s->http_code == 401) {
213213 if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
214214 s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t