Skip to content

Commit 4bbd86b

Browse files
author
roman
committed
test_two_channels BUGFIX write to correct sessions
1 parent e5675b1 commit 4bbd86b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/test_two_channels.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ server_thread(void *arg)
4747
assert_non_null(ps);
4848

4949
while (del_session_count < 2) {
50-
msgtype = nc_accept(0, ctx, &session);
50+
msgtype = nc_accept(0, ctx, &new_session);
5151

5252
if (msgtype == NC_MSG_HELLO) {
53-
ret = nc_ps_add_session(ps, session);
53+
ret = nc_ps_add_session(ps, new_session);
5454
assert_int_equal(ret, 0);
5555
}
5656

57-
ret = nc_ps_poll(ps, 0, &new_session);
57+
ret = nc_ps_poll(ps, 0, &session);
5858

5959
if (ret & NC_PSPOLL_SESSION_TERM) {
60-
nc_ps_del_session(ps, new_session);
61-
nc_session_free(new_session, NULL);
60+
nc_ps_del_session(ps, session);
61+
nc_session_free(session, NULL);
6262
del_session_count++;
6363
} else if (ret & NC_PSPOLL_SSH_CHANNEL) {
6464
msgtype = nc_session_accept_ssh_channel(session, &new_session);

0 commit comments

Comments
 (0)