diff --git a/apps/backend/backend_client.c b/apps/backend/backend_client.c index 61c834d0..30858e6b 100644 --- a/apps/backend/backend_client.c +++ b/apps/backend/backend_client.c @@ -320,27 +320,22 @@ backend_client_rm(clixon_handle h, struct client_entry **ce_prev; uint32_t myid = ce->ce_id; yang_stmt *yspec; - int retval = -1; /* If the confirmed-commit feature is enabled, rollback any ephemeral commit originated by this client */ - if ((yspec = clicon_dbspec_yang(h)) == NULL) { - clixon_err(OE_YANG, ENOENT, "No yang spec"); - goto done; - } - if (if_feature(yspec, "ietf-netconf", "confirmed-commit")) { - if (confirmed_commit_state_get(h) == EPHEMERAL) { - /* See if this client is the origin */ - clixon_debug(CLIXON_DBG_BACKEND, "session_id: %u, confirmed_commit.session_id: %u", ce->ce_id, confirmed_commit_session_id_get(h)); - - if (myid == confirmed_commit_session_id_get(h)) { - clixon_debug(CLIXON_DBG_BACKEND, "ok, rolling back"); - clixon_log(h, LOG_NOTICE, "a client with an active ephemeral confirmed-commit has disconnected; rolling back"); - - /* do_rollback errors are logged internally and there is no client to report errors to, so errors are - * ignored here. - */ - cancel_rollback_event(h); - do_rollback(h, NULL); + if ((yspec = clicon_dbspec_yang(h)) != NULL) { + if (if_feature(yspec, "ietf-netconf", "confirmed-commit")) { + if (confirmed_commit_state_get(h) == EPHEMERAL) { + /* See if this client is the origin */ + clixon_debug(CLIXON_DBG_BACKEND, "session_id: %u, confirmed_commit.session_id: %u", ce->ce_id, confirmed_commit_session_id_get(h)); + if (myid == confirmed_commit_session_id_get(h)) { + clixon_debug(CLIXON_DBG_BACKEND, "ok, rolling back"); + clixon_log(h, LOG_NOTICE, "a client with an active ephemeral confirmed-commit has disconnected; rolling back"); + /* do_rollback errors are logged internally and there is no client to report errors to, so errors are + * ignored here. + */ + cancel_rollback_event(h); + do_rollback(h, NULL); + } } } } @@ -363,9 +358,7 @@ backend_client_rm(clixon_handle h, } ce_prev = &c->ce_next; } - retval = backend_client_delete(h, ce); /* actually purge it */ - done: - return retval; + return backend_client_delete(h, ce); /* actually purge it */ } /*! Get clixon per datastore stats diff --git a/apps/backend/clixon_backend_handle.c b/apps/backend/clixon_backend_handle.c index 03065963..5e8f95bc 100644 --- a/apps/backend/clixon_backend_handle.c +++ b/apps/backend/clixon_backend_handle.c @@ -118,6 +118,7 @@ backend_handle_exit(clixon_handle h) { struct client_entry *ce; + stream_delete_all(h, 1); /* only delete client structs, not close sockets, etc, see backend_client_rm WHY NOT? */ while ((ce = backend_client_list(h)) != NULL){ if (ce->ce_s){ diff --git a/apps/cli/cli_generate.c b/apps/cli/cli_generate.c index 50d849e6..1a289226 100644 --- a/apps/cli/cli_generate.c +++ b/apps/cli/cli_generate.c @@ -1845,8 +1845,11 @@ yang2cli_yspec(clixon_handle h, clixon_err(OE_YANG, errno, "Failing clispec: %s", cbuf_get(cb)); goto done; } - clixon_debug(CLIXON_DBG_CLI, "Generated auto-cli for module:%s", - yang_filename_get(ymod)); + clixon_debug(CLIXON_DBG_CLI, "%s", cbuf_get(cbname)); + if (cbname){ + cbuf_free(cbname); + cbname = NULL; + } /* Add prefix: assume new are appended */ for (i=0; ies_subscription, struct stream_subscription *); diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c index 67c10c3c..c26c58f1 100644 --- a/lib/src/clixon_yang.c +++ b/lib/src/clixon_yang.c @@ -960,7 +960,7 @@ yspec_new_shared(clixon_handle h, yang_flag_set(yspec1, YANG_FLAG_SPEC_MOUNT); clixon_debug(CLIXON_DBG_YANG, "new yang-spec: %p", yspec1); } - if (yang_cvec_add(yspec1, CGV_STRING, xpath) < 0){ + if (yang_cvec_add(yspec1, CGV_STRING, xpath) == NULL){ yspec1 = NULL; goto done; } @@ -1102,7 +1102,6 @@ ys_free1(yang_stmt *ys, free(ys->ys_nscache); break; #endif - default: break; }