From ed19b4076e0ec9252202086e65ffcc42510b6cdd Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sun, 24 Nov 2019 13:20:24 +0100 Subject: Add download_chunk_size property to HTTPRequest. This allows setting the `read_chunk_size` of the internal HTTPClient. This is important to reduce the allocation overhead and number of file writes when downloading large files, allowing for better download speed. --- platform/javascript/http_client_javascript.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform/javascript') diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp index e6e933811f..1f3f2ed53c 100644 --- a/platform/javascript/http_client_javascript.cpp +++ b/platform/javascript/http_client_javascript.cpp @@ -211,6 +211,10 @@ void HTTPClient::set_read_chunk_size(int p_size) { read_limit = p_size; } +int HTTPClient::get_read_chunk_size() const { + return read_limit; +} + Error HTTPClient::poll() { switch (status) { -- cgit v1.2.3