mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
channel: Don't send EOF on channel more than once
Signed-off-by: Till Wimmer <g4-lisz@tonarchiv.ch> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Andreas Schneider
parent
9340a0af5e
commit
95ab5f0dce
@@ -1195,6 +1195,11 @@ int ssh_channel_send_eof(ssh_channel channel)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* If the EOF has already been sent we're done here. */
|
||||
if (channel->local_eof != 0) {
|
||||
return SSH_OK;
|
||||
}
|
||||
|
||||
session = channel->session;
|
||||
|
||||
err = ssh_buffer_pack(session->out_buffer,
|
||||
@@ -1257,10 +1262,7 @@ int ssh_channel_close(ssh_channel channel)
|
||||
|
||||
session = channel->session;
|
||||
|
||||
if (channel->local_eof == 0) {
|
||||
rc = ssh_channel_send_eof(channel);
|
||||
}
|
||||
|
||||
rc = ssh_channel_send_eof(channel);
|
||||
if (rc != SSH_OK) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user