MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / DownloadAsync

Function DownloadAsync

src/TexturePack.c:698–711  ·  view source on GitHub ↗

Asynchronously downloads the given texture pack */

Source from the content-addressed store, hash-verified

696
697/* Asynchronously downloads the given texture pack */
698static 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
713void TexturePack_Extract(const cc_string* url) {
714 if (url->length) DownloadAsync(url);

Callers 1

TexturePack_ExtractFunction · 0.85

Calls 5

IsCachedFunction · 0.85
GetCachedLastModifiedFunction · 0.85
GetCachedETagFunction · 0.85
Http_TryCancelFunction · 0.70
Http_AsyncGetDataExFunction · 0.70

Tested by

no test coverage detected