RequestServer: Actually hold on to the preload job until it's done

This was some nonsense code left in by mistake, ref commit:
4211639e45

Fixes #904.
This commit is contained in:
Ali Mohammad Pur 2024-07-30 16:08:37 +02:00 committed by Tim Flynn
parent b445b907a1
commit 93216a875e
Notes: github-actions[bot] 2024-07-30 16:04:27 +00:00
2 changed files with 2 additions and 3 deletions

View file

@ -100,8 +100,7 @@ struct JobData {
} }
#endif #endif
template<typename T> static JobData create(auto job, [[maybe_unused]] URL::URL url)
static JobData create(WeakPtr<T> job, [[maybe_unused]] URL::URL url)
{ {
return JobData { return JobData {
[job](auto& socket) { job->start(socket); }, [job](auto& socket) { job->start(socket); },

View file

@ -162,7 +162,7 @@ void ConnectionFromClient::worker_do_work(Work work)
dbgln("EnsureConnection: Pre-connect to {}", url); dbgln("EnsureConnection: Pre-connect to {}", url);
auto do_preconnect = [=, job = Job::ensure(url)](auto& cache) { auto do_preconnect = [=, job = Job::ensure(url)](auto& cache) {
ConnectionCache::ensure_connection(cache, url, job->make_weak_ptr<Job>()); ConnectionCache::ensure_connection(cache, url, move(job));
}; };
if (url.scheme() == "http"sv) if (url.scheme() == "http"sv)