LibWeb/WebDriver: Close client connection socket when EOF is reached

Fixes the bug that currently we don't ever close webdriver client
connection socket when header "Connection: keep-alive" is specified.

This allows to run more WPT tests without running out of free file
descriptors :)
This commit is contained in:
Aliaksandr Kalenik 2023-06-19 16:16:10 +03:00 committed by Tim Flynn
parent d4f5e6eb81
commit f04ae5f542
Notes: sideshowbarker 2024-07-16 23:52:10 +09:00

View file

@ -219,8 +219,10 @@ ErrorOr<void, Client::WrappedError> Client::on_ready_to_read()
auto data = TRY(m_socket->read_some(buffer));
TRY(m_remaining_request.try_append(StringView { data }));
if (m_socket->is_eof())
if (m_socket->is_eof()) {
die();
break;
}
}
if (m_remaining_request.is_empty())