mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-12 19:20:27 +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);
|
window_len = MIN(window, len);
|
||||||
|
|
||||||
/* Route the data to the right exception channel */
|
/* Route the data to the right exception channel */
|
||||||
if (is_stderr && (connector->out_flags & SSH_CONNECTOR_STDERR)) {
|
if (connector->out_flags & SSH_CONNECTOR_STDOUT &&
|
||||||
w = ssh_channel_write_stderr(connector->out_channel,
|
!(is_stderr && (connector->out_flags & SSH_CONNECTOR_STDERR))) {
|
||||||
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) {
|
|
||||||
w = ssh_channel_write(connector->out_channel,
|
w = ssh_channel_write(connector->out_channel,
|
||||||
data,
|
data,
|
||||||
window_len);
|
window_len);
|
||||||
|
|||||||
Reference in New Issue
Block a user