Commit b01f5ba2 authored by Martin Storsjö's avatar Martin Storsjö

http: Print an error message for Authorization Required, too

The error was hidden before, to avoid showing an error on the
first request where no auth has been provided, when the server
indicates which authentication method to use.

Now the error is printed if an authentication method was used,
but failed.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent e1e22851
......@@ -236,7 +236,8 @@ static int process_line(URLContext *h, char *line, int line_count,
/* error codes are 4xx and 5xx, but regard 401 as a success, so we
* don't abort until all headers have been parsed. */
if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) {
if (s->http_code >= 400 && s->http_code < 600 && (s->http_code != 401
|| s->auth_state.auth_type != HTTP_AUTH_NONE)) {
end += strspn(end, SPACE_CHARS);
av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n",
s->http_code, end);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment