MCPcopy Create free account
hub / github.com/EasyRPG/Player / download_failure_retry

Function download_failure_retry

src/async_handler.cpp:96–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 void start_async_wget_with_retry(async_download_context* ctx);
95
96 void download_failure_retry(unsigned, void* userData, int status) {
97 auto ctx = static_cast<async_download_context*>(userData);
98 ++ctx->count;
99 if (ctx->count >= ASYNC_MAX_RETRY_COUNT) {
100 Output::Warning("DL Failure: max retries exceeded: {}", ctx->obj->GetPath());
101 ctx->obj->DownloadDone(false);
102 delete ctx;
103 return;
104 }
105 if (status >= 400) {
106 Output::Warning("DL Failure: file not available: {}", ctx->obj->GetPath());
107 ctx->obj->DownloadDone(false);
108 delete ctx;
109 return;
110 }
111 Output::Debug("DL Failure: {}. Retrying", ctx->obj->GetPath());
112 start_async_wget_with_retry(ctx);
113 }
114
115 void start_async_wget_with_retry(async_download_context* ctx) {
116 emscripten_async_wget2(

Callers

nothing calls this directly

Calls 3

GetPathMethod · 0.80
DownloadDoneMethod · 0.80

Tested by

no test coverage detected