diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b29c09b..718837a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ endif() # Generic version of not only the library. Major version is reserved for really big changes of the project, # minor version changes with added functionality (new tool, functionality of the tool or library, ...) and # micro version is changed with a set of small changes or bugfixes anywhere in the project. -set(NP2SRV_VERSION 2.8.16) +set(NP2SRV_VERSION 2.8.17) # libyang required version set(LIBYANG_DEP_VERSION 6.3.0) @@ -49,8 +49,8 @@ set(LIBYANG_DEP_SOVERSION 5.9.2) set(LIBYANG_DEP_SOVERSION_MAJOR 5) # libnetconf2 required version -set(LIBNETCONF2_DEP_VERSION 4.4.3) -set(LIBNETCONF2_DEP_SOVERSION 5.4.3) +set(LIBNETCONF2_DEP_VERSION 4.6.0) +set(LIBNETCONF2_DEP_SOVERSION 5.4.19) set(LIBNETCONF2_DEP_SOVERSION_MAJOR 5) # sysrepo required version @@ -156,16 +156,6 @@ if(PkgConfig_FOUND) pkg_check_modules(PKG_LN2 libnetconf2) if(PKG_LN2_FOUND) - # libnetconf2 thread count check - pkg_get_variable(LN2_THREAD_COUNT libnetconf2 "LN2_MAX_THREAD_COUNT") - if(LN2_THREAD_COUNT) - if(LN2_THREAD_COUNT LESS THREAD_COUNT) - message(FATAL_ERROR "libnetconf2 was compiled with support up to ${LN2_THREAD_COUNT} threads, server is configured with ${THREAD_COUNT}.") - else() - message(STATUS "libnetconf2 was compiled with support of up to ${LN2_THREAD_COUNT} threads") - endif() - endif() - # get libnetconf2 module directory, use it later when installing modules pkg_get_variable(LN2_YANG_MODULE_DIR libnetconf2 "LN2_SCHEMAS_DIR") endif() @@ -173,9 +163,6 @@ endif() # } PKGCONFIG -if(NOT LN2_THREAD_COUNT) - message(STATUS "Unable to learn libnetconf2 thread support, check skipped") -endif() if(NOT LN2_YANG_MODULE_DIR) message(FATAL_ERROR "Unable to learn libnetconf2 module search directory, define LN2_YANG_MODULE_DIR manually.") endif() diff --git a/src/main.c b/src/main.c index 66a57325..3f6893ce 100644 --- a/src/main.c +++ b/src/main.c @@ -121,15 +121,16 @@ signal_handler(int sig) * @brief Callback for deleting NC sessions. * * @param[in] session NC session to delete. + * @param[in] in_ps Whether @p session is still in the pollsession. */ static void -np2srv_del_session_cb(struct nc_session *session) +np2srv_del_session_cb(struct nc_session *session, int in_ps) { struct np_user_sess *user_sess; uint32_t i; /* remove from PS structure */ - if (nc_ps_del_session(np2srv.nc_ps, session)) { + if (in_ps && nc_ps_del_session(np2srv.nc_ps, session)) { ERR("Removing session from ps failed."); } @@ -1115,7 +1116,7 @@ server_destroy(void) while (nc_ps_session_count(np2srv.nc_ps)) { sess = nc_ps_get_session(np2srv.nc_ps, 0); nc_session_set_term_reason(sess, NC_SESSION_TERM_OTHER); - np2srv_del_session_cb(sess); + np2srv_del_session_cb(sess, 1); sr_release_context(np2srv.sr_conn); } nc_ps_free(np2srv.nc_ps); @@ -1554,7 +1555,7 @@ worker_thread(void *arg) } if (rc & NC_PSPOLL_SESSION_TERM) { VRB("Session %d: thread %d event session terminated.", nc_session_get_id(ncs), idx); - np2srv_del_session_cb(ncs); + np2srv_del_session_cb(ncs, 0); sr_release_context(np2srv.sr_conn); } #ifdef NC_ENABLED_SSH_TLS