| 1111 | } |
| 1112 | |
| 1113 | static 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 | |
| 1136 | static void parse_expires(HTTPContext *s, const char *p) |
| 1137 | { |
no test coverage detected