1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibHTTP: Remove redundant can_read_without_blocking call

When entering the InBody state LibHTTP performs a
can_read_without_blocking check, which is duplicated immediately
afterwards. This initial call is removed.
This commit is contained in:
Wesley Moore 2022-02-12 08:07:31 +10:00 committed by Ali Mohammad Pur
parent 12ff5c9bfd
commit 849f849905

View file

@ -380,12 +380,6 @@ void Job::on_socket_connected()
} }
VERIFY(m_state == State::InBody); VERIFY(m_state == State::InBody);
auto can_read_without_blocking = m_socket->can_read_without_blocking();
if (can_read_without_blocking.is_error())
return deferred_invoke([this] { did_fail(Core::NetworkJob::Error::TransmissionFailed); });
if (!can_read_without_blocking.value())
return;
while (true) { while (true) {
auto can_read_without_blocking = m_socket->can_read_without_blocking(); auto can_read_without_blocking = m_socket->can_read_without_blocking();
if (can_read_without_blocking.is_error()) if (can_read_without_blocking.is_error())