summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWebSocket/Impl
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-09-19 02:31:11 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-09-19 21:10:23 +0430
commit436693c0c907b9a15bd6cccc07304e6332bc7b7b (patch)
tree494319887de437c6590d0cdc2c263e6510f8e953 /Userland/Libraries/LibWebSocket/Impl
parentd3ea0818f3dc6f744e6176e9bd1633e3085d6b71 (diff)
downloadserenity-436693c0c907b9a15bd6cccc07304e6332bc7b7b.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWebSocket/Impl')
-rw-r--r--Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.cpp b/Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.cpp
index 370f77c4eb..b3313ca9e6 100644
--- a/Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.cpp
+++ b/Userland/Libraries/LibWebSocket/Impl/TLSv12WebSocketConnectionImpl.cpp
@@ -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();
};