Skip to content

Commit ebcca44

Browse files
Roytakmichalvasko
authored andcommitted
session server REFACTOR server destroy docs
1 parent a0afda5 commit ebcca44

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/session_server.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,7 +3884,7 @@ nc_connect_ch_client_dispatch(const char *client_name, nc_server_ch_session_acqu
38843884

38853885
NC_CHECK_SRV_INIT_RET(-1);
38863886

3887-
/* CONFIG READ LOCK */
3887+
/* CONFIG WRITE LOCK */
38883888
if (nc_rwlock_lock(&server_opts.config_lock, NC_RWLOCK_WRITE, NC_CONFIG_LOCK_TIMEOUT, __func__) != 1) {
38893889
return -1;
38903890
}
@@ -3898,7 +3898,7 @@ nc_connect_ch_client_dispatch(const char *client_name, nc_server_ch_session_acqu
38983898
new_session_cb, new_session_cb_data);
38993899

39003900
cleanup:
3901-
/* CONFIG READ UNLOCK */
3901+
/* CONFIG WRITE UNLOCK */
39023902
nc_rwlock_unlock(&server_opts.config_lock, __func__);
39033903
return rc;
39043904
}

src/session_server.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,11 @@ struct nc_server_reply *nc_clb_default_close_session(struct lyd_node *rpc, struc
142142
int nc_server_init(void);
143143

144144
/**
145-
* @brief Destroy any dynamically allocated libssh and/or libssl/libcrypto and
146-
* server resources.
145+
* @brief Destroy any dynamically allocated libssh and/or libssl/libcrypto and server resources.
147146
*
148-
* Can be called multiple times, even if a previous call failed.
149-
*
150-
* @return 0 on success, 1 on error - all resources could not be freed safely.
147+
* @return 0 on success, 1 on error - failed to synchronize with other threads
148+
* (timed out waiting for locks or failed to join threads). Safe to call
149+
* again to retry freeing resources.
151150
*/
152151
int nc_server_destroy(void);
153152

0 commit comments

Comments
 (0)