mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +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: 3fdc595e0c
1 changed files with 5 additions and 2 deletions
|
@ -124,8 +124,11 @@ void CHttpJob::start()
|
||||||
on_socket_connected();
|
on_socket_connected();
|
||||||
};
|
};
|
||||||
bool success = m_socket->connect(m_request.url().host(), m_request.url().port());
|
bool success = m_socket->connect(m_request.url().host(), m_request.url().port());
|
||||||
if (!success)
|
if (!success) {
|
||||||
|
deferred_invoke([this](auto&) {
|
||||||
return did_fail(CNetworkJob::Error::ConnectionFailed);
|
return did_fail(CNetworkJob::Error::ConnectionFailed);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHttpJob::shutdown()
|
void CHttpJob::shutdown()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue