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

Re: sftp_read receives EOF on second call for a 24kb file


 

 Hi Kevin,

Assuming remote to local transfer:

You read the first chunk of data, and use sftp_seek to move the file pointer

 

-----Original Message-----
From: Kevin Lambert <klambert@xxxxxxxxx>
To: libssh@xxxxxxxxxx
Sent: Tue, 22 Oct 2013 23:45
Subject: Re: sftp_read receives EOF on second call for a 24kb file


How were you able to read it in chunks if sftp_read only returns EOF on subsequent reads?
On Oct 22, 2013 6:43 PM, "Darren" <d.tomlin@xxxxxxxxxxxx> wrote:



Hi Kevin,


I had the same problem when reading a file although not sure if it is a bug I did file a bug report, the way I solved this 
issue is to read the file in chunks and keep track of the file pointer position, each time reading the next chunk of data until eof.

Hope this helps


-----Original Message-----
From: Kevin Lambert <klambert@xxxxxxxxx>
To: libssh <libssh@xxxxxxxxxx>
Sent: Tue, 22 Oct 2013 20:11
Subject: sftp_read receives EOF on second call for a 24kb file



I have built and am running libssh 0.5.5 for windows x32 and am trying to pull a 24kb file over.  I have my buffer size set to 1024 (but have tried 4096 with the same result).  The first call to sftp_read returns back 1024 as the count of bytes read but the subsequent call returns 0.  When I stepped through sftp_read I found that sftp_read was receiving SSH_FX_EOF even though there is still 23kb left to read.  Am I opening the ssh or sftp session incorrectly?  I have attached the relevant code.
 
Thanks,
 
Kevin
 

 
 
 

 

Follow-Ups:
Re: sftp_read receives EOF on second call for a 24kb fileKevin Lambert <klambert@xxxxxxxxx>
Re: sftp_read receives EOF on second call for a 24kb fileAndreas Schneider <asn@xxxxxxxxxxxxxx>
References:
Re: sftp_read receives EOF on second call for a 24kb fileKevin Lambert <klambert@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org