handleMSG_CHANNEL_DATA method

void handleMSG_CHANNEL_DATA(
  1. MSG_CHANNEL_DATA msg
)

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);
}