summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibHTTP/Job.cpp
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-10-04 14:18:15 +0330
committerAndreas Kling <kling@serenityos.org>2021-10-04 13:06:03 +0200
commitfdd2d49c5b6befe8ef2da0400b4ecbe33a00502c (patch)
treeffec176f9270ccfe13bc98337bbdf11bf4d2a24c /Userland/Libraries/LibHTTP/Job.cpp
parent3564e4eff1790b7ea3db74c300bd8b9fdd0af020 (diff)
downloadserenity-fdd2d49c5b6befe8ef2da0400b4ecbe33a00502c.zip
LibHTTP: Ignore empty reads on chunk boundaries
Diffstat (limited to 'Userland/Libraries/LibHTTP/Job.cpp')
-rw-r--r--Userland/Libraries/LibHTTP/Job.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp
index c60ebb8651..a850bef3af 100644
--- a/Userland/Libraries/LibHTTP/Job.cpp
+++ b/Userland/Libraries/LibHTTP/Job.cpp
@@ -240,6 +240,8 @@ void Job::on_socket_connected()
auto size_lines = size_data.view().lines();
dbgln_if(JOB_DEBUG, "Job: Received a chunk with size '{}'", size_data);
if (size_lines.size() == 0) {
+ if (!eof())
+ return AK::IterationDecision::Continue;
dbgln("Job: Reached end of stream");
finish_up();
return IterationDecision::Break;