Skip to content

Commit a4ba60f

Browse files
committed
session BUGFIX process leftover messages on session close
To avoid problems with receiving <close-session> reply.
1 parent e53d260 commit a4ba60f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/session.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,11 @@ nc_session_free(struct nc_session *session, void (*data_free)(void *))
618618
free(p);
619619
}
620620

621+
/* receive any leftover messages */
622+
while (nc_read_msg_poll_io(session, 0, &msg) == 1) {
623+
ly_in_free(msg, 1);
624+
}
625+
621626
if (session->status == NC_STATUS_RUNNING) {
622627
/* send closing info to the other side */
623628
ietfnc = ly_ctx_get_module_implemented(session->ctx, "ietf-netconf");

0 commit comments

Comments
 (0)