Skip to content

Commit 29be237

Browse files
author
krizsa
committed
bugfix
1 parent 05e573d commit 29be237

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/sftp.cc

+9-3
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,11 @@ int SFTP::continueSpawn(eio_req *req)
534534
//fprintf(stderr, "2\n");
535535
pthis->m_size = ssh_channel_read(pthis->m_ssh_channel,
536536
pthis->m_path,SSH_MIN(available, 1024),0);
537-
if (pthis->m_size==0)
537+
if (pthis->m_size<=0)
538538
pthis->m_done = 1;
539+
if (pthis->m_size < 0) {
540+
pthis->m_size = 0;
541+
}
539542
}
540543
else if (available < 0) {
541544
//fprintf(stderr, "3\n");
@@ -549,8 +552,11 @@ int SFTP::continueSpawn(eio_req *req)
549552
//fprintf(stderr, "4\n");
550553
pthis->m_size2 = ssh_channel_read(pthis->m_ssh_channel,
551554
pthis->m_path2,SSH_MIN(available2, 1024),1);
552-
if (pthis->m_size2==0)
553-
pthis->m_done = 1;
555+
if (pthis->m_size2<=0)
556+
pthis->m_done = 1;
557+
if (pthis->m_size2 < 0) {
558+
pthis->m_size2 = 0;
559+
}
554560
}
555561
else if (available2 < 0) {
556562
//fprintf(stderr, "5\n");

wscript

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def build(bld):
2525
]
2626
ssh.cxxflags = [ '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE' ]
2727

28-
ssh.staticlib = 'SSH'
28+
ssh.staticlib = 'ssh'

0 commit comments

Comments
 (0)