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

Function cookie_string

libavformat/http.c:1113–1134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1111}
1112
1113static int cookie_string(AVDictionary *dict, char **cookies)
1114{
1115 const AVDictionaryEntry *e = NULL;
1116 int len = 1;
1117
1118 // determine how much memory is needed for the cookies string
1119 while ((e = av_dict_iterate(dict, e)))
1120 len += strlen(e->key) + strlen(e->value) + 1;
1121
1122 // reallocate the cookies
1123 e = NULL;
1124 if (*cookies) av_free(*cookies);
1125 *cookies = av_malloc(len);
1126 if (!*cookies) return AVERROR(ENOMEM);
1127 *cookies[0] = '\0';
1128
1129 // write out the cookies
1130 while ((e = av_dict_iterate(dict, e)))
1131 av_strlcatf(*cookies, len, "%s%s\n", e->key, e->value);
1132
1133 return 0;
1134}
1135
1136static void parse_expires(HTTPContext *s, const char *p)
1137{

Callers 1

http_read_headerFunction · 0.85

Calls 4

av_dict_iterateFunction · 0.85
av_strlcatfFunction · 0.85
av_freeFunction · 0.50
av_mallocFunction · 0.50

Tested by

no test coverage detected