From a5674fab69a02b7844ffb4e3ff0de217abe5fb45 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Wed, 29 Jun 2016 20:50:00 +0300 Subject: [PATCH] fix onConnect not being called if there are no clients --- src/AsyncEventSource.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/AsyncEventSource.cpp b/src/AsyncEventSource.cpp index 6ca9bad..4118f7f 100644 --- a/src/AsyncEventSource.cpp +++ b/src/AsyncEventSource.cpp @@ -182,6 +182,8 @@ void AsyncEventSource::onConnect(ArEventHandlerFunction cb){ void AsyncEventSource::_addClient(AsyncEventSourceClient * client){ if(_clients == NULL){ _clients = client; + if(_connectcb) + _connectcb(client); return; } AsyncEventSourceClient * c = _clients;