We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1868757 commit 0f118c3Copy full SHA for 0f118c3
1 file changed
src/session.c
@@ -881,8 +881,25 @@ nc_session_free(struct nc_session *session, void (*data_free)(void *))
881
struct ly_in *msg;
882
struct timespec ts;
883
void *p;
884
+ NC_STATUS status;
885
- if (!session || (session->status == NC_STATUS_CLOSING)) {
886
+ if (!session) {
887
+ return;
888
+ }
889
+
890
+ if ((session->side == NC_SERVER) && (session->flags & NC_SESSION_CALLHOME)) {
891
+ /* CH LOCK */
892
+ pthread_mutex_lock(&session->opts.server.ch_lock);
893
894
895
+ status = session->status;
896
897
898
+ /* CH UNLOCK */
899
+ pthread_mutex_unlock(&session->opts.server.ch_lock);
900
901
902
+ if (status == NC_STATUS_CLOSING) {
903
return;
904
}
905
0 commit comments