Skip to content

Commit cf6a158

Browse files
committed
session server BUGFIX invalid reply send
1 parent f36be34 commit cf6a158

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/session_server.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2635,16 +2635,20 @@ nc_ps_poll(struct nc_pollsession *ps, int timeout, struct nc_session **session)
26352635
if (ret == NC_PSPOLL_RPC) {
26362636
ret = nc_server_recv_rpc_io(cur_session, timeout, &rpc);
26372637
if (ret & (NC_PSPOLL_ERROR | NC_PSPOLL_BAD_RPC)) {
2638+
/* error, do not send a reply */
26382639
if (cur_session->status != NC_STATUS_RUNNING) {
26392640
ret |= NC_PSPOLL_SESSION_TERM | NC_PSPOLL_SESSION_ERROR;
26402641
cur_ps_session->state = NC_PS_STATE_INVALID;
26412642
} else {
26422643
cur_ps_session->state = NC_PS_STATE_NONE;
26432644
}
2645+
} else if (ret & NC_PSPOLL_REPLY_ERROR) {
2646+
/* error reply has been sent */
2647+
cur_ps_session->state = NC_PS_STATE_NONE;
26442648
} else {
26452649
cur_session->opts.server.last_rpc = ts_cur.tv_sec;
26462650

2647-
/* process RPC */
2651+
/* process RPC and send a reply */
26482652
ret |= nc_server_send_reply_io(cur_session, timeout, rpc);
26492653
if (cur_session->status != NC_STATUS_RUNNING) {
26502654
ret |= NC_PSPOLL_SESSION_TERM;

0 commit comments

Comments
 (0)