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

Function FetchUpdateTask_Handle

src/LWeb.c:590–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588*#########################################################################################################################*/
589struct FetchUpdateData FetchUpdateTask;
590static void FetchUpdateTask_Handle(cc_uint8* data, cc_uint32 len) {
591 static const cc_string path = String_FromConst(UPDATE_FILE);
592 cc_result res;
593
594 res = Stream_WriteAllTo(&path, data, len);
595 if (res) { Logger_SysWarn(res, "saving update"); return; }
596
597 res = Updater_SetNewBuildTime(FetchUpdateTask.timestamp);
598 if (res) Logger_SysWarn(res, "setting update time");
599
600 res = Updater_MarkExecutable();
601 if (res) Logger_SysWarn(res, "making update executable");
602
603#ifdef CC_BUILD_WIN
604 Options_SetBool("update-dirty", true);
605#endif
606}
607
608void FetchUpdateTask_Run(cc_bool release, int buildIndex) {
609 cc_string url; char urlBuffer[URL_MAX_SIZE];

Callers

nothing calls this directly

Calls 5

Stream_WriteAllToFunction · 0.85
Logger_SysWarnFunction · 0.85
Options_SetBoolFunction · 0.85
Updater_SetNewBuildTimeFunction · 0.70
Updater_MarkExecutableFunction · 0.70

Tested by

no test coverage detected