From 14b2f9092027b47f665e1e6a87998967b8001efb Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 16 Jul 2019 12:38:09 +0200 Subject: [PATCH] LibCore: Always call on_connected whether the connection was synchronous or not It's unreasonable to expect the client to have to call it themselves if the connection was immediate (local). --- Libraries/LibCore/CSocket.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Libraries/LibCore/CSocket.cpp b/Libraries/LibCore/CSocket.cpp index b0ca5df109..ff424ea7a7 100644 --- a/Libraries/LibCore/CSocket.cpp +++ b/Libraries/LibCore/CSocket.cpp @@ -66,9 +66,12 @@ bool CSocket::connect(const CSocketAddress& address, int port) } perror("connect"); exit(1); + } else { + dbg() << *this << " connected ok!"; + m_connected = true; + if (on_connected) + on_connected(); } - dbg() << *this << " connected ok!"; - m_connected = true; return true; }