aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/scp.c b/src/scp.c
index a2efa321..9be5744c 100644
--- a/src/scp.c
+++ b/src/scp.c
@@ -419,7 +419,11 @@ int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len){
if(scp->processed + len > scp->filelen)
len = (size_t) (scp->filelen - scp->processed);
/* hack to avoid waiting for window change */
- ssh_channel_poll(scp->channel,0);
+ r = ssh_channel_poll(scp->channel, 0);
+ if (r == SSH_ERROR) {
+ scp->state = SSH_SCP_ERROR;
+ return SSH_ERROR;
+ }
w=ssh_channel_write(scp->channel,buffer,len);
if(w != SSH_ERROR)
scp->processed += w;