1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

flush channel after EOF and CLOSE

This commit is contained in:
Rod Vagg
2013-07-11 18:34:49 +10:00
committed by Aris Adamantiadis
parent 78ea8608b0
commit 94db978218

View File

@@ -1147,6 +1147,10 @@ int ssh_channel_send_eof(ssh_channel channel){
channel->local_channel, channel->local_channel,
channel->remote_channel); channel->remote_channel);
rc = ssh_channel_flush(channel);
if(rc == SSH_ERROR)
goto error;
channel->local_eof = 1; channel->local_eof = 1;
return rc; return rc;
@@ -1203,6 +1207,10 @@ int ssh_channel_close(ssh_channel channel){
channel->state=SSH_CHANNEL_STATE_CLOSED; channel->state=SSH_CHANNEL_STATE_CLOSED;
} }
rc = ssh_channel_flush(channel);
if(rc == SSH_ERROR)
goto error;
return rc; return rc;
error: error:
buffer_reinit(session->out_buffer); buffer_reinit(session->out_buffer);