浏览代码

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).
Ali Mohammad Pur 3 年之前
父节点
当前提交
82da36f129
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibHTTP/Job.cpp

+ 1 - 1
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;