From fc9233f198b353cb4be85ac61d3933dfe4fba23f Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 15 Oct 2025 12:56:00 -0400 Subject: [PATCH] RequestServer: Delete unreadable cache files (for now) If we are unable to pipe the response body from a cache file to the client, let's take the extra safe approach of deleting the cache file for now. We already remove the file if we weren't able to read its metadata during initialization. --- Services/RequestServer/Cache/CacheEntry.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Services/RequestServer/Cache/CacheEntry.cpp b/Services/RequestServer/Cache/CacheEntry.cpp index b975af67e94..4dc9dcceda1 100644 --- a/Services/RequestServer/Cache/CacheEntry.cpp +++ b/Services/RequestServer/Cache/CacheEntry.cpp @@ -346,6 +346,10 @@ void CacheEntryReader::pipe_error(Error error) { dbgln("\033[31;1mError transferring cache to pipe for\033[0m {}: {}", m_url, error); + // FIXME: We may not want to actually remove the cache file for all errors. For now, let's assume the file is not + // useable at this point and remove it. + remove(); + if (m_on_pipe_error) m_on_pipe_error(m_bytes_piped);