MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / check_http_code

Function check_http_code

libavformat/http.c:888–901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888static 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
903static int parse_location(HTTPContext *s, const char *p)
904{

Callers 1

process_lineFunction · 0.85

Calls 2

av_logFunction · 0.85
ff_http_averrorFunction · 0.85

Tested by

no test coverage detected