Subject: Small binary files are getting transferred but not the larger ones in libssh2 SFTP

Small binary files are getting transferred but not the larger ones in libssh2 SFTP

From: kali muthu <direct2kali_at_gmail.com>
Date: Thu, 3 Mar 2011 15:51:58 +0530

Hi,
I am using the libssh2_sftp_read() to read the remote server files which are
binary. I am using the session in non-blocking mode. I can able to transfer
text files and smaller binary files.

When I transfer a binary file of size of 2437 bytes, it gets transferred
completely. While another binary file of size around 36 MB, I am not able to
obtain the entire contents. The received file has bits and pieces of data
from the original file. The received file has a size of just around 3 KBs. I
am using the below sinppet for reading the contents.

do{
readStatus = libssh2_sftp_read(m_sftpHandle,buffer,1024);
}while(readStatus == LIBSSH2_ERROR_EAGAIN);

But the text files irrespective of their size are getting transferred
completely. The problem arises only for large binary files. Any pointers
regarding this are welcome.

-- 
Regards,
Kali

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-03-03