From e1a5ffd231e9910bd14a9a9a00be79c432224e4b Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 21 Feb 2024 18:51:43 -0800 Subject: [PATCH] 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. --- src/internal.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/internal.c b/src/internal.c index e43f88ca..11e8bc5c 100644 --- a/src/internal.c +++ b/src/internal.c @@ -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);