mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibTLS: Use a setter for on_tls_ready_to_write with some more smarts
The callback should be called as soon as the connection is established, and if we actually set the callback when it already is, we expect it to be called immediately.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
d3ea0818f3
commit
436693c0c9
Notes:
sideshowbarker
2024-07-18 03:39:50 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/436693c0c90 Pull-request: https://github.com/SerenityOS/serenity/pull/10103 Reviewed-by: https://github.com/awesomekling
@@ -33,9 +33,10 @@ void TLSv12WebSocketConnectionImpl::connect(ConnectionInfo const& connection)
|
||||
m_socket->on_tls_ready_to_read = [this](auto&) {
|
||||
on_ready_to_read();
|
||||
};
|
||||
m_socket->on_tls_ready_to_write = [this](auto&) {
|
||||
m_socket->set_on_tls_ready_to_write([this](auto& tls) {
|
||||
tls.set_on_tls_ready_to_write(nullptr);
|
||||
on_connected();
|
||||
};
|
||||
});
|
||||
m_socket->on_tls_finished = [this] {
|
||||
on_connection_error();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user