summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-10-10 01:41:17 +0330
committerAndreas Kling <kling@serenityos.org>2021-10-10 00:27:44 +0200
commit82da36f129de923a1ed0b34cbecb20d5b96763b8 (patch)
tree68d771535d5abc296b1303245092443874045ac5
parente8891e6d56fe001c92a3981f59e747283238a02f (diff)
downloadserenity-82da36f129de923a1ed0b34cbecb20d5b96763b8.zip
LibHTTP: Quit the read loop when an incomplete chunk size line is seen
If we don't quit, the underlying socket won't get a chance to do much other than nothing while we spin in read_while_data_available(). Fixes some possible RS spin (especially seen in Google's cookie consent page).
-rw-r--r--Userland/Libraries/LibHTTP/Job.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp
index 346a538dfc..4b32fc4e47 100644
--- a/Userland/Libraries/LibHTTP/Job.cpp
+++ b/Userland/Libraries/LibHTTP/Job.cpp
@@ -245,7 +245,7 @@ void Job::on_socket_connected()
dbgln_if(JOB_DEBUG, "Job: Received a chunk with size '{}'", size_data);
if (size_lines.size() == 0) {
if (!eof())
- return AK::IterationDecision::Continue;
+ return AK::IterationDecision::Break;
dbgln("Job: Reached end of stream");
finish_up();
return IterationDecision::Break;