handleMSG_CHANNEL_DATA method
Data transfer is done with messages of the type SSH_MSG_CHANNEL_DATA.
Implementation
void handleMSG_CHANNEL_DATA(MSG_CHANNEL_DATA msg) {
if (tracePrint != null) {
tracePrint(
'$hostport: MSG_CHANNEL_DATA: channel ${msg.recipientChannel} : ${msg.data.length} bytes');
}
Channel chan = channels[msg.recipientChannel];
if (chan == null) {
throw FormatException('$hostport: data for invalid channel');
}
chan.windowS -= (packetLen - packetMacLen - 4);
if (chan.windowS < initialWindowSize ~/ 2) {
writeClearOrEncrypted(
MSG_CHANNEL_WINDOW_ADJUST(chan.remoteId, initialWindowSize));
chan.windowS += initialWindowSize;
}
handleChannelData(chan, msg.data);
}