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

Function parse_http_date

libavformat/http.c:989–1012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

987}
988
989static int parse_http_date(const char *date_str, struct tm *buf)
990{
991 char date_buf[MAX_DATE_LEN];
992 int i, j, date_buf_len = MAX_DATE_LEN-1;
993 char *date;
994
995 // strip off any punctuation or whitespace
996 for (i = 0, j = 0; date_str[i] != '\0' && j < date_buf_len; i++) {
997 if ((date_str[i] >= '0' && date_str[i] <= '9') ||
998 (date_str[i] >= 'A' && date_str[i] <= 'Z') ||
999 (date_str[i] >= 'a' && date_str[i] <= 'z')) {
1000 date_buf[j] = date_str[i];
1001 j++;
1002 }
1003 }
1004 date_buf[j] = '\0';
1005 date = date_buf;
1006
1007 // move the string beyond the day of week
1008 while ((*date < '0' || *date > '9') && *date != '\0')
1009 date++;
1010
1011 return av_small_strptime(date, "%d%b%Y%H%M%S", buf) ? 0 : AVERROR(EINVAL);
1012}
1013
1014static int parse_set_cookie(const char *set_cookie, AVDictionary **dict)
1015{

Callers 4

parse_cookieFunction · 0.85
parse_expiresFunction · 0.85
process_lineFunction · 0.85
get_cookiesFunction · 0.85

Calls 1

av_small_strptimeFunction · 0.85

Tested by

no test coverage detected