LibRequests: Add hooks to handle RequestServer death

This commit is contained in:
Timothy Flynn 2025-08-09 13:07:09 -04:00 committed by Andreas Kling
commit 6f4be4791a
Notes: github-actions[bot] 2025-08-10 09:04:18 +00:00
3 changed files with 11 additions and 2 deletions

View file

@ -19,8 +19,12 @@ RequestClient::~RequestClient() = default;
void RequestClient::die()
{
// FIXME: Gracefully handle this, or relaunch and reconnect to RequestServer.
warnln("\033[31;1m {} Lost connection to RequestServer\033[0m", Core::System::getpid());
for (auto& [id, request] : m_requests) {
if (request)
request->did_finish({}, {}, {}, NetworkError::RequestServerDied);
}
m_requests.clear();
}
void RequestClient::ensure_connection(URL::URL const& url, ::RequestServer::CacheLevel cache_level)