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
201 HTTPContext *s = h->priv_data;201 HTTPContext *s = h->priv_data;
202 int location_changed, attempts = 0, redirects = 0;202 int location_changed, attempts = 0, redirects = 0;
203redo:203redo:
204 cur_auth_type = s->auth_state.auth_type;
205 cur_proxy_auth_type = s->auth_state.auth_type;
206
204 location_changed = http_open_cnx_internal(h, options);207 location_changed = http_open_cnx_internal(h, options);
205 if (location_changed < 0)208 if (location_changed < 0)
206 goto fail;209 goto fail;
207 210
208 attempts++;211 attempts++;
209 cur_auth_type = s->auth_state.auth_type;
210 cur_proxy_auth_type = s->auth_state.auth_type;
211
212 if (s->http_code == 401) {212 if (s->http_code == 401) {
213 if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&213 if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
214 s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {214 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