summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-11-10 18:21:17 +0200
committerMartin Storsjö <martin@martin.st>2011-11-11 14:07:48 +0200
commitb01f5ba2070e022e6cf6c1fa8410367e90e33b60 (patch)
tree0cbf9f3b04ffff058727be2ca8f9f7b20d70e8f5 /libavformat/http.c
parente1e22851c15b2b88de111353f53fe4c94431f883 (diff)
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: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 83ffc0b60e..093bb822dc 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -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);