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

Function http_should_reconnect

libavformat/http.c:327–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327static int http_should_reconnect(HTTPContext *s, int err)
328{
329 const char *status_group;
330 char http_code[4];
331
332 switch (err) {
333 case AVERROR_HTTP_BAD_REQUEST:
334 case AVERROR_HTTP_UNAUTHORIZED:
335 case AVERROR_HTTP_FORBIDDEN:
336 case AVERROR_HTTP_NOT_FOUND:
337 case AVERROR_HTTP_TOO_MANY_REQUESTS:
338 case AVERROR_HTTP_OTHER_4XX:
339 status_group = "4xx";
340 break;
341
342 case AVERROR_HTTP_SERVER_ERROR:
343 status_group = "5xx";
344 break;
345
346 default:
347 return s->reconnect_on_network_error;
348 }
349
350 if (!s->reconnect_on_http_error)
351 return 0;
352
353 if (av_match_list(status_group, s->reconnect_on_http_error, ',') > 0)
354 return 1;
355
356 snprintf(http_code, sizeof(http_code), "%d", s->http_code);
357
358 return av_match_list(http_code, s->reconnect_on_http_error, ',') > 0;
359}
360
361static char *redirect_cache_get(HTTPContext *s)
362{

Callers 1

http_open_cnxFunction · 0.85

Calls 1

av_match_listFunction · 0.85

Tested by

no test coverage detected