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.
Unified · Split
| @@ -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; |
| 203 | redo: | 203 | redo: |
| 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) { |