Asynchronously downloads the given texture pack */
| 696 | |
| 697 | /* Asynchronously downloads the given texture pack */ |
| 698 | static void DownloadAsync(const cc_string* url) { |
| 699 | cc_string etag = String_Empty; |
| 700 | cc_string time = String_Empty; |
| 701 | |
| 702 | /* Only retrieve etag/last-modified headers if the file exists */ |
| 703 | /* This inconsistency can occur if user deleted some cached files */ |
| 704 | if (IsCached(url)) { |
| 705 | time = GetCachedLastModified(url); |
| 706 | etag = GetCachedETag(url); |
| 707 | } |
| 708 | |
| 709 | Http_TryCancel(TexturePack_ReqID); |
| 710 | TexturePack_ReqID = Http_AsyncGetDataEx(url, HTTP_FLAG_PRIORITY, &time, &etag, NULL); |
| 711 | } |
| 712 | |
| 713 | void TexturePack_Extract(const cc_string* url) { |
| 714 | if (url->length) DownloadAsync(url); |
no test coverage detected