mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibCore: CHttpJob::start() should fail asynchronously
Clients are expected to have a chance to set up an on_finish callback before we finish or fail.
This commit is contained in:
parent
31ac19543a
commit
3fdc595e0c
Notes:
sideshowbarker
2024-07-19 11:45:14 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3fdc595e0c7
1 changed files with 5 additions and 2 deletions
|
@ -124,8 +124,11 @@ void CHttpJob::start()
|
|||
on_socket_connected();
|
||||
};
|
||||
bool success = m_socket->connect(m_request.url().host(), m_request.url().port());
|
||||
if (!success)
|
||||
return did_fail(CNetworkJob::Error::ConnectionFailed);
|
||||
if (!success) {
|
||||
deferred_invoke([this](auto&) {
|
||||
return did_fail(CNetworkJob::Error::ConnectionFailed);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void CHttpJob::shutdown()
|
||||
|
|
Loading…
Add table
Reference in a new issue