| 886 | } |
| 887 | |
| 888 | static int check_http_code(URLContext *h, int http_code, const char *end) |
| 889 | { |
| 890 | HTTPContext *s = h->priv_data; |
| 891 | /* error codes are 4xx and 5xx, but regard 401 as a success, so we |
| 892 | * don't abort until all headers have been parsed. */ |
| 893 | if (http_code >= 400 && http_code < 600 && |
| 894 | (http_code != 401 || s->auth_state.auth_type != HTTP_AUTH_NONE) && |
| 895 | (http_code != 407 || s->proxy_auth_state.auth_type != HTTP_AUTH_NONE)) { |
| 896 | end += strspn(end, SPACE_CHARS); |
| 897 | av_log(h, AV_LOG_WARNING, "HTTP error %d %s\n", http_code, end); |
| 898 | return ff_http_averror(http_code, AVERROR(EIO)); |
| 899 | } |
| 900 | return 0; |
| 901 | } |
| 902 | |
| 903 | static int parse_location(HTTPContext *s, const char *p) |
| 904 | { |
no test coverage detected