From 12ff5c9bfdef2f6d7826881976cce548b016a18c Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Sat, 12 Feb 2022 08:01:46 +1000 Subject: [PATCH] LibHTTP: Remove attempt to read extra line after response headers When LibHTTP encountered the blank line between the headers and the body in a HTTP response it made a call the m_socket->can_read_line(). This ultimately tried to find a newline in the stream. If the response body was small and did not contain a new line then the request would hang. The call to m_socket->can_read_line() is removed so that the code is able to progress into the body reading loop. --- Userland/Libraries/LibHTTP/Job.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp index e07e234d66..fa6914a119 100644 --- a/Userland/Libraries/LibHTTP/Job.cpp +++ b/Userland/Libraries/LibHTTP/Job.cpp @@ -316,12 +316,6 @@ void Job::on_socket_connected() if (m_code == 204) return finish_up(); - can_read_line = m_socket->can_read_line(); - if (can_read_line.is_error()) - return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); }); - - if (!can_read_line.value()) - return; break; } auto parts = line.split_view(':');