Channel Callbacks (EOF and Close)

1. Add checks for the Channel EOF or Close callbacks to the Do functions
   for those messages, and call them.
pull/713/head
John Safranek 2024-02-21 18:51:43 -08:00
parent 06b70db8f4
commit e1a5ffd231
1 changed files with 12 additions and 0 deletions

View File

@ -7958,6 +7958,12 @@ static int DoChannelEof(WOLFSSH* ssh,
ret = WS_INVALID_CHANID;
}
if (ret == WS_SUCCESS) {
if (ssh->ctx->channelEofCb) {
ssh->ctx->channelEofCb(channel, ssh->channelEofCtx);
}
}
if (ret == WS_SUCCESS) {
channel->eofRxd = 1;
if (!channel->eofTxd) {
@ -7991,6 +7997,12 @@ static int DoChannelClose(WOLFSSH* ssh,
ret = WS_INVALID_CHANID;
}
if (ret == WS_SUCCESS) {
if (ssh->ctx->channelCloseCb) {
ssh->ctx->channelCloseCb(channel, ssh->channelCloseCtx);
}
}
if (ret == WS_SUCCESS) {
if (!channel->closeTxd) {
ret = SendChannelClose(ssh, channel->peerChannel);