| 359 | } |
| 360 | |
| 361 | static char *redirect_cache_get(HTTPContext *s) |
| 362 | { |
| 363 | AVDictionaryEntry *re; |
| 364 | int64_t expiry; |
| 365 | char *delim; |
| 366 | |
| 367 | re = av_dict_get(s->redirect_cache, s->location, NULL, AV_DICT_MATCH_CASE); |
| 368 | if (!re) { |
| 369 | return NULL; |
| 370 | } |
| 371 | |
| 372 | delim = strchr(re->value, ';'); |
| 373 | if (!delim) { |
| 374 | return NULL; |
| 375 | } |
| 376 | |
| 377 | expiry = strtoll(re->value, NULL, 10); |
| 378 | if (time(NULL) > expiry) { |
| 379 | return NULL; |
| 380 | } |
| 381 | |
| 382 | return delim + 1; |
| 383 | } |
| 384 | |
| 385 | static int redirect_cache_set(HTTPContext *s, const char *source, const char *dest, int64_t expiry) |
| 386 | { |
no test coverage detected