| 392 | } |
| 393 | |
| 394 | Result Close(HCache cache) |
| 395 | { |
| 396 | for (uint32_t i = 0; i < MAX_CACHE_CREATORS; ++i) |
| 397 | { |
| 398 | CacheCreator* h = &cache->m_CacheCreators[i]; |
| 399 | if (h->m_Filename) |
| 400 | { |
| 401 | free(h->m_Filename); |
| 402 | } |
| 403 | |
| 404 | if (h->m_File) |
| 405 | { |
| 406 | fclose(h->m_File); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | Flush(cache); |
| 411 | delete cache; |
| 412 | return RESULT_OK; |
| 413 | } |
| 414 | |
| 415 | Result Begin(HCache cache, const char* uri, const char* etag, uint32_t max_age, |
| 416 | uint32_t range_start, uint32_t range_end, uint32_t document_size, HCacheCreator* cache_creator) |