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

Function TexturePack_CheckPending

src/TexturePack.c:675–695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675void TexturePack_CheckPending(void) {
676 struct HttpRequest item;
677 if (!Http_GetResult(TexturePack_ReqID, &item)) return;
678
679 if (item.success) {
680 ApplyDownloaded(&item);
681 } else if (item.result) {
682 Http_LogError("trying to download texture pack", &item);
683 } else if (item.statusCode == 200 || item.statusCode == 304) {
684 /* Empty responses is okay for these status codes, so don't log an error */
685 } else if (item.statusCode == 404) {
686 Chat_AddRaw("&c404 Not Found error when trying to download texture pack");
687 Chat_AddRaw(" &cThe texture pack URL may be incorrect or no longer exist");
688 } else if (item.statusCode == 401 || item.statusCode == 403) {
689 Chat_Add1("&c%i Not Authorised error when trying to download texture pack", &item.statusCode);
690 Chat_AddRaw(" &cThe texture pack URL may not be publicly shared");
691 } else {
692 Chat_Add1("&c%i error when trying to download texture pack", &item.statusCode);
693 }
694 HttpRequest_Free(&item);
695}
696
697/* Asynchronously downloads the given texture pack */
698static void DownloadAsync(const cc_string* url) {

Callers 2

SPConnection_TickFunction · 0.85
MPConnection_TickFunction · 0.85

Calls 6

ApplyDownloadedFunction · 0.85
Chat_AddRawFunction · 0.85
Chat_Add1Function · 0.85
Http_GetResultFunction · 0.70
Http_LogErrorFunction · 0.70
HttpRequest_FreeFunction · 0.70

Tested by

no test coverage detected