summaryrefslogtreecommitdiff
path: root/platform/javascript/http_client_javascript.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-11-24 13:20:24 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-11-24 19:32:20 +0100
commited19b4076e0ec9252202086e65ffcc42510b6cdd (patch)
tree58d0a83b8aa20f96df854259c06743e6dd69ff47 /platform/javascript/http_client_javascript.cpp
parent37b230fe3af3c7e20a6f938d03b61a79b117d354 (diff)
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.
Diffstat (limited to 'platform/javascript/http_client_javascript.cpp')
-rw-r--r--platform/javascript/http_client_javascript.cpp4
1 files changed, 4 insertions, 0 deletions
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) {