Skip to content

Commit

Permalink
ccall: improved state changes during UPDATEs
Browse files Browse the repository at this point in the history
  • Loading branch information
c-g-owen committed Oct 13, 2021
1 parent cf4934b commit 1cf7df6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ccall/ccall.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,8 @@ static int ccall_send_msg_sft(struct ccall *ccall,
if (err)
goto out;

if (ECONN_SETUP == msg->msg_type &&
if ((ECONN_SETUP == msg->msg_type ||
ECONN_UPDATE == msg->msg_type) &&
CCALL_STATE_ACTIVE != ccall->state) {
set_state(ccall, CCALL_STATE_CONNECTING);
}
Expand Down Expand Up @@ -3092,6 +3093,17 @@ int ccall_sft_msg_recv(struct icall* icall,
ccall->sft_resolved = true;
}
}
else if (ECONN_UPDATE == msg->msg_type) {
if (CCALL_STATE_CONNSENT != ccall->state) {
info("ccall(%p): sft_msg_recv ignoring "
"UPDATE from sft %s in state %s\n",
ccall,
msg->u.setup.url ? msg->u.setup.url : "NULL",
ccall_state_name(ccall->state));
return 0;
}
set_state(ccall, CCALL_STATE_SETUPRECV);
}
if (!ccall->ecall) {
create_ecall(ccall);
info("ccall(%p): sft_url=[%s]\n", ccall, msg->u.setup.url);
Expand Down

0 comments on commit 1cf7df6

Please sign in to comment.