1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

LibProtocol: Bump download stream buffer to PAGE_SIZE

I think this should scale based on the network speed (or download
rate?), but for the time being, 4K seems to be good-enough.
This commit is contained in:
AnotherTest 2021-01-30 14:23:34 +03:30 committed by Andreas Kling
parent 904e1002b8
commit 322936115e

View file

@ -57,7 +57,7 @@ void Download::stream_into(OutputStream& stream)
}; };
notifier->on_ready_to_read = [this, &stream, user_on_finish = move(user_on_finish)] { notifier->on_ready_to_read = [this, &stream, user_on_finish = move(user_on_finish)] {
constexpr size_t buffer_size = 1 * KiB; constexpr size_t buffer_size = PAGE_SIZE;
static char buf[buffer_size]; static char buf[buffer_size];
auto nread = m_internal_stream_data->read_stream.read({ buf, buffer_size }); auto nread = m_internal_stream_data->read_stream.read({ buf, buffer_size });
if (!stream.write_or_error({ buf, nread })) { if (!stream.write_or_error({ buf, nread })) {