]> granicus.if.org Git - icinga2/commitdiff
Avoid duplicate API connections
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 5 Aug 2014 07:10:59 +0000 (09:10 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 5 Aug 2014 07:10:59 +0000 (09:10 +0200)
refs #6724

lib/remote/apilistener.cpp

index b404e1ef76565e3057644257e9360c024e20c9c7..fd70b0c0b3163cf29e39a91ac9389f2b029a10f1 100644 (file)
@@ -301,6 +301,8 @@ void ApiListener::NewClientHandler(const Socket::Ptr& client, ConnectionRole rol
        aclient->Start();
 
        if (endpoint) {
+               endpoint->AddClient(aclient);
+
                if (need_sync) {
                        {
                                ObjectLock olock(endpoint);
@@ -312,8 +314,6 @@ void ApiListener::NewClientHandler(const Socket::Ptr& client, ConnectionRole rol
                }
 
                SendConfigUpdate(aclient);
-
-               endpoint->AddClient(aclient);
        } else
                AddAnonymousClient(aclient);
 }