| 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( |
nothing calls this directly
no test coverage detected