]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[907-remove-kea-thread-library] Finished netconf
authorFrancis Dupont <fdupont@isc.org>
Sat, 21 Sep 2019 12:55:05 +0000 (14:55 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 27 Sep 2019 09:07:21 +0000 (11:07 +0200)
src/bin/netconf/netconf_process.cc

index 769efebb99c32f3eec43dc8906214b417100bf0d..228450e6b25633bc2e57d5755988796c74d7e496 100644 (file)
@@ -47,6 +47,7 @@ NetconfProcess::run() {
     try {
         // Initialize netconf agent in a thread.
         std::thread th([this]() {
+            try {
                 if (shouldShutdown()) {
                     return;
                 }
@@ -66,8 +67,18 @@ NetconfProcess::run() {
 
                 // Call init.
                 agent_.init(cfg_mgr);
+            } catch (...) {
+                // Should not happen but in case...
+                std::exception_ptr eptr = std::current_exception();
+                getIoService()->post([eptr] () {
+                    if (eptr) {
+                        std::rethrow_exception(eptr);
+                    }
+                });
+            }
         });
 
+        // Detach the thread.
         th.detach();
 
         // Let's process incoming data or expiring timers in a loop until