mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38: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
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
Add a link
Reference in a new issue