ladybird/Services/RequestServer
Andreas Kling f0765e80f3 RequestServer: Avoid O(N^2) copy when draining response buffer
write_queued_bytes_without_blocking() used to allocate a Vector sized
to the entire queued response buffer and memcpy every queued byte into
it, on every curl on_data_received callback. When the client pipe was
slower than the network, the buffer grew, and each arriving chunk
triggered a full copy of everything still queued. With enough pending
data this added up to tens of gigabytes of memcpy per request and
stalled RequestServer for tens of seconds.

Drain the stream in a loop using peek_some_contiguous() + send()
directly from the underlying chunk, and discard exactly what the
socket accepted. No intermediate buffer, no copy. The loop exits on
EAGAIN and enables the writer notifier, matching the previous
back-pressure behavior.
2026-04-22 13:32:07 +02:00
..
CacheLevel.h Everywhere: Hoist the Services folder to the top-level 2024-11-10 12:50:45 +01:00
CMakeLists.txt Meta: Remove a Qt option related from RequestServer's CMakeLists 2026-04-20 16:41:29 -06:00
ConnectionFromClient.cpp RequestServer: Disable curl socket notifiers when no longer needed 2026-04-21 15:45:41 +02:00
ConnectionFromClient.h RequestServer: Use correct request map for stale-while-revalidate cookie 2026-04-13 19:43:13 -04:00
CURL.cpp LibRequests+RequestServer: Add an error code for CURLE_PARTIAL_FILE 2026-01-08 11:59:12 +01:00
CURL.h RequestServer: Move some cURL utilities to their own file 2025-10-28 11:52:51 +01:00
Forward.h LibHTTP+RequestServer: Move the HTTP cache implementation to LibHTTP 2025-11-29 08:35:02 -05:00
main.cpp Everywhere: Replace Unix socket IPC transport with Mach ports on macOS 2026-03-23 18:50:48 +01:00
Request.cpp RequestServer: Avoid O(N^2) copy when draining response buffer 2026-04-22 13:32:07 +02:00
Request.h RequestServer: Move Request::Type enum to its own file 2026-04-13 19:43:13 -04:00
RequestClient.ipc RequestServer: Use correct request map for stale-while-revalidate cookie 2026-04-13 19:43:13 -04:00
RequestPipe.cpp RequestServer: Increase RequestPipe socket buffer sizes 2026-03-15 09:06:06 -04:00
RequestPipe.h LibCore+RequestServer: Return size_t from system read/write functions 2025-12-01 16:29:48 +01:00
RequestServer.ipc RequestServer: Use correct request map for stale-while-revalidate cookie 2026-04-13 19:43:13 -04:00
RequestType.h RequestServer: Move Request::Type enum to its own file 2026-04-13 19:43:13 -04:00
Resolver.cpp RequestServer: Move Resolver (and related structures) to its own file 2025-10-28 11:52:51 +01:00
Resolver.h RequestServer: Move Resolver (and related structures) to its own file 2025-10-28 11:52:51 +01:00
ResourceSubstitutionMap.cpp RequestServer: Add --resource-map option for URL-to-file substitution 2026-01-19 10:23:26 +01:00
ResourceSubstitutionMap.h RequestServer: Add --resource-map option for URL-to-file substitution 2026-01-19 10:23:26 +01:00
WebSocketImplCurl.cpp LibWebSocket+RequestServer: Handle connection drop during closing 2026-03-13 17:28:06 +01:00
WebSocketImplCurl.h RequestServer: Enable in Windows CI 2025-08-23 16:04:36 -06:00