Skip to content
Permalink
Browse files

Fix scp state when empty channel is returned.

  • Loading branch information
colinw-smartrg committed Dec 11, 2019
1 parent 96bbefb commit 3273607c49623297743aa195481c65f13548fcbc
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/scp.c
@@ -755,7 +755,10 @@ scp_recv(LIBSSH2_SESSION * session, const char *path, libssh2_struct_stat * sb)
_libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL,
"Unexpected channel close");
else
{
session->scpRecv_state = libssh2_NB_state_idle;
return session->scpRecv_channel;
}
/* fall-through */
scp_recv_error:
tmp_err_code = session->err_code;
@@ -1099,7 +1102,10 @@ scp_send(LIBSSH2_SESSION * session, const char *path, int mode,
"Unexpected channel close");
}
else
{
session->scpSend_state = libssh2_NB_state_idle;
return session->scpSend_channel;
}
/* fall-through */
scp_send_error:
tmp_err_code = session->err_code;

0 comments on commit 3273607

Please sign in to comment.
You can’t perform that action at this time.