From 93216a875eb58924e380fe1489cc5d35912c62b7 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 30 Jul 2024 16:08:37 +0200 Subject: [PATCH] RequestServer: Actually hold on to the preload job until it's done This was some nonsense code left in by mistake, ref commit: 4211639e455c8f58f23304be5312ad48a76e401a Fixes #904. --- Userland/Services/RequestServer/ConnectionCache.h | 3 +-- Userland/Services/RequestServer/ConnectionFromClient.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Services/RequestServer/ConnectionCache.h b/Userland/Services/RequestServer/ConnectionCache.h index ecb5389c5c9..f9dd0317e1f 100644 --- a/Userland/Services/RequestServer/ConnectionCache.h +++ b/Userland/Services/RequestServer/ConnectionCache.h @@ -100,8 +100,7 @@ struct JobData { } #endif - template - static JobData create(WeakPtr job, [[maybe_unused]] URL::URL url) + static JobData create(auto job, [[maybe_unused]] URL::URL url) { return JobData { [job](auto& socket) { job->start(socket); }, diff --git a/Userland/Services/RequestServer/ConnectionFromClient.cpp b/Userland/Services/RequestServer/ConnectionFromClient.cpp index bc562b24c16..33b3563d8e6 100644 --- a/Userland/Services/RequestServer/ConnectionFromClient.cpp +++ b/Userland/Services/RequestServer/ConnectionFromClient.cpp @@ -162,7 +162,7 @@ void ConnectionFromClient::worker_do_work(Work work) dbgln("EnsureConnection: Pre-connect to {}", url); auto do_preconnect = [=, job = Job::ensure(url)](auto& cache) { - ConnectionCache::ensure_connection(cache, url, job->make_weak_ptr()); + ConnectionCache::ensure_connection(cache, url, move(job)); }; if (url.scheme() == "http"sv)