Subject: SCP Transfer example Hangs

SCP Transfer example Hangs

From: Armen Babakhanian <>
Date: Mon, 19 Mar 2012 11:28:09 -0700 (PDT)

I'm using VC++ 2008.

I've ran this example from the libssh2 website
( a few time and everytime it's hangs
at the very last few bytes it needs to receive. I ran a debugger to see where
the problem was occurring and it happened when this line:

        if((fileinfo.st_size -got) < amount) { amount =
fileinfo.st_size -got; }got executed before

        t_rc = libssh2_channel_read(t_channel, mem, amount);

which is where the app hangs.

When I remove the amount setter, then it works fine, however from time to time
the data received is not correct. meaning the md5sum value is not the same as
the origin.

Received on 2012-03-19