1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:28:11 +00:00

LibCore: Make NetworkJob::start() take a Stream::BufferedSocketBase&

It used to take a plain `Socket` and cast it to a `BufferedSocketBase`,
which can lead to unpleasant result when used with a non-buffered
`Socket`.
This commit is contained in:
Lucas CHOLLET 2023-02-09 19:07:11 -05:00 committed by Jelle Raaijmakers
parent 5fc873f53b
commit ff47223301
6 changed files with 8 additions and 8 deletions

View file

@ -92,10 +92,10 @@ Job::Job(HttpRequest&& request, Stream& output_stream)
{
}
void Job::start(Core::Socket& socket)
void Job::start(Core::BufferedSocketBase& socket)
{
VERIFY(!m_socket);
m_socket = static_cast<Core::BufferedSocketBase*>(&socket);
m_socket = &socket;
dbgln_if(HTTPJOB_DEBUG, "Reusing previous connection for {}", url());
deferred_invoke([this] {
dbgln_if(HTTPJOB_DEBUG, "HttpJob: on_connected callback");