summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-07-16 12:38:09 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-16 13:18:37 +0200
commit14b2f9092027b47f665e1e6a87998967b8001efb (patch)
tree36b1eb0439e39acc8de68e061cb6957b6bac6a9d
parent41d2c674d764314c2930bcf4bfcf2992bf6b5cb8 (diff)
downloadserenity-14b2f9092027b47f665e1e6a87998967b8001efb.zip
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).
-rw-r--r--Libraries/LibCore/CSocket.cpp7
1 files 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;
}