[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sftp_write hangs


On Friday, October 29, 2010 08:03:40 you wrote:
> Hello,
> 
> I have build a sftp client that downloads and uploads files from
> OpenSSH for Windows server.
> 
> I have tried to download more than 10mb files, and when I traced the
> function calls, it will run through sftp_write and the program will
> get back the focus, but the downloading of file will not start.
> 
> Here is a sample code:
> flWrite = sftp_open(sftp, strRemoteFilePath, O_WRONLY | O_CREAT |
> O_TRUNC, 0700);
> 
> nSizeRead = oLocalFile.Read(data, nFileSize);
> nSizeWrite = sftp_write(flWrite, data, nSizeRead);
> 
> oLocalFile.Close();
> sftp_close(flWrite);
> 
> 
> Am i coding it right? meaning should i write it multiple times in
> smaller bytes rather than 1 big write?

Hi,


you should work with smaller chunks. Take a look e.g. at the ::get function

http://websvn.kde.org/trunk/KDE/kdebase/runtime/kioslave/sftp/kio_sftp.cpp?view=markup


	-- andreas


References:
sftp_write hangsAlan Ong <sarcasigan@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org