SendChannel fix

When changing the functions SendChannelData() and
SendChannelAdjustWindow() to use the self channel ID instead of the peer
channel ID, forgot to update a couple instances. The test case at the
time had matching ID numbers for self and peer and happened to work.
pull/276/head
John Safranek 2020-08-26 13:10:40 -07:00
parent 728a6c2e73
commit ede1f01752
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
2 changed files with 5 additions and 7 deletions

View File

@ -4839,7 +4839,7 @@ static int DoChannelExtendedData(WOLFSSH* ssh,
DumpOctetString(buf + begin, dataSz);
#endif
if (ret == WS_SUCCESS) {
ret = SendChannelWindowAdjust(ssh, channel->peerChannel,dataSz);
ret = SendChannelWindowAdjust(ssh, channel->channel, dataSz);
}
}
*idx = begin + dataSz;

View File

@ -1026,8 +1026,7 @@ int wolfSSH_stream_read(WOLFSSH* ssh, byte* buf, word32 bufSz)
inputBuffer->buffer + bytesToAdd, usedSz);
}
sendResult = SendChannelWindowAdjust(ssh,
ssh->channelList->peerChannel,
sendResult = SendChannelWindowAdjust(ssh, ssh->channelList->channel,
bytesToAdd);
if (sendResult != WS_SUCCESS)
bufSz = sendResult;
@ -1093,7 +1092,7 @@ int wolfSSH_stream_send(WOLFSSH* ssh, byte* buf, word32 bufSz)
return (ret == WS_SUCCESS)? bytesTxd : ret;
}
bytesTxd = SendChannelData(ssh, ssh->channelList->peerChannel, buf, bufSz);
bytesTxd = SendChannelData(ssh, ssh->channelList->channel, buf, bufSz);
WLOG(WS_LOG_DEBUG, "Leaving wolfSSH_stream_send(), txd = %d", bytesTxd);
return bytesTxd;
@ -1876,8 +1875,7 @@ int wolfSSH_ChannelRead(WOLFSSH_CHANNEL* channel, byte* buf, word32 bufSz)
inputBuffer->buffer + bytesToAdd, usedSz);
}
sendResult = SendChannelWindowAdjust(channel->ssh,
channel->peerChannel,
sendResult = SendChannelWindowAdjust(channel->ssh, channel->channel,
bytesToAdd);
if (sendResult != WS_SUCCESS)
bufSz = sendResult;
@ -1916,7 +1914,7 @@ int wolfSSH_ChannelSend(WOLFSSH_CHANNEL* channel,
}
else {
WLOG(WS_LOG_DEBUG, "Sending data.");
bytesTxd = SendChannelData(channel->ssh, channel->peerChannel,
bytesTxd = SendChannelData(channel->ssh, channel->channel,
(byte*)buf, bufSz);
}