summaryrefslogtreecommitdiff
path: root/Servers/ProtocolServer/HttpsDownload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Servers/ProtocolServer/HttpsDownload.cpp')
-rw-r--r--Servers/ProtocolServer/HttpsDownload.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Servers/ProtocolServer/HttpsDownload.cpp b/Servers/ProtocolServer/HttpsDownload.cpp
index d7114cd7d9..c883a178d9 100644
--- a/Servers/ProtocolServer/HttpsDownload.cpp
+++ b/Servers/ProtocolServer/HttpsDownload.cpp
@@ -35,8 +35,17 @@ HttpsDownload::HttpsDownload(PSClientConnection& client, NonnullRefPtr<HTTP::Htt
m_job->on_finish = [this](bool success) {
if (m_job->response())
set_payload(m_job->response()->payload());
+
+ // if we didn't know the total size, pretend that the download finished successfully
+ // and set the total size to the downloaded size
+ if (!total_size().has_value())
+ did_progress(downloaded_size(), downloaded_size());
+
did_finish(success);
};
+ m_job->on_progress = [this](Optional<u32> total, u32 current) {
+ did_progress(total, current);
+ };
}
HttpsDownload::~HttpsDownload()