Skip to content

Commit

Permalink
Terminate session if terminate message received over holepunch session
Browse files Browse the repository at this point in the history
  • Loading branch information
streetpea committed Sep 19, 2024
1 parent d5c5866 commit df4d6e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/src/remote/holepunch.c
Original file line number Diff line number Diff line change
Expand Up @@ -4246,6 +4246,12 @@ static ChiakiErrorCode wait_for_session_message(
CHIAKI_LOGE(session->log, "Failed to parse holepunch session message");
return err;
}
if(msg->action & SESSION_MESSAGE_ACTION_TERMINATE)
{
CHIAKI_LOGW(session->log, "Holepunch session received Terminate message, terminating %d", msg->action);
err = CHIAKI_ERR_CANCELED;
return err;
}
if (!(msg->action & types))
{
CHIAKI_LOGV(session->log, "Ignoring holepunch session message with action %d", msg->action);
Expand Down

0 comments on commit df4d6e9

Please sign in to comment.