mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00: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:
parent
d3ea0818f3
commit
436693c0c9
6 changed files with 28 additions and 13 deletions
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue