fputc(buf[i], stderr);
return;
}
- while (len--)
- c_write1(*buf++);
-}
-
-static void c_writedata (char *buf, int len) {
- while (len--)
- c_write1(*buf++);
+ from_backend(1, buf, len);
}
/*
if (pktin.type == SSH1_SMSG_STDOUT_DATA ||
pktin.type == SSH1_SMSG_STDERR_DATA) {
long len = GET_32BIT(pktin.body);
- c_writedata(pktin.body+4, len);
+ from_backend(pktin.type == SSH1_SMSG_STDERR_DATA,
+ pktin.body+4, len);
} else if (pktin.type == SSH1_MSG_DISCONNECT) {
ssh_state = SSH_STATE_CLOSED;
logevent("Received disconnect request");
continue; /* extended but not stderr */
ssh2_pkt_getstring(&data, &length);
if (data) {
- c_writedata(data, length);
+ from_backend(pktin.type == SSH2_MSG_CHANNEL_EXTENDED_DATA,
+ data, length);
/*
* Enlarge the window again at the remote side,
* just in case it ever runs down and they fail