mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-12 11:10:28 +09:00
connector: Simplify handling of out/err channels
Based on stale MR !461. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -542,16 +542,8 @@ static int ssh_connector_channel_data_cb(ssh_session session,
|
||||
window_len = MIN(window, len);
|
||||
|
||||
/* Route the data to the right exception channel */
|
||||
if (is_stderr && (connector->out_flags & SSH_CONNECTOR_STDERR)) {
|
||||
w = ssh_channel_write_stderr(connector->out_channel,
|
||||
data,
|
||||
window_len);
|
||||
} else if (!is_stderr &&
|
||||
(connector->out_flags & SSH_CONNECTOR_STDOUT)) {
|
||||
w = ssh_channel_write(connector->out_channel,
|
||||
data,
|
||||
window_len);
|
||||
} else if (connector->out_flags & SSH_CONNECTOR_STDOUT) {
|
||||
if (connector->out_flags & SSH_CONNECTOR_STDOUT &&
|
||||
!(is_stderr && (connector->out_flags & SSH_CONNECTOR_STDERR))) {
|
||||
w = ssh_channel_write(connector->out_channel,
|
||||
data,
|
||||
window_len);
|
||||
|
||||
Reference in New Issue
Block a user