Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-21 Thread Alexander Lamaison
2008/12/19 Daniel Stenberg : > On Thu, 18 Dec 2008, Markus Moeller wrote: > >> 1) Alexander's read with large buffer fails issue. > >> 2) My (and possibly Aleksey's) issue. > > Thanks for your work and patience with this. I've now committed both these > fixes! Fantastic work guys. I confirm this

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-19 Thread Daniel Stenberg
On Thu, 18 Dec 2008, Markus Moeller wrote: > 1) Alexander's read with large buffer fails issue. > 2) My (and possibly Aleksey's) issue. Thanks for your work and patience with this. I've now committed both these fixes! -- / daniel.haxx.se ---

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-18 Thread E L
> As I mailed before there seem to be two issues: > > 1) Alexander's read with large buffer fails issue. >The reason for this is that in sftp.c line 1025 > libssh2_htonu32(s, buffer_maxlen); > needs to be changed to > libssh2_htonu32(s, bytes_requested); >The reason

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-18 Thread Markus Moeller
"Daniel Stenberg" wrote in message news:alpine.lrh.2.00.0812182112120.22...@yvahk3.pbagnpgbe.fr... > On Thu, 18 Dec 2008, Markus Moeller wrote: > >> Should I open a bug for this on sourceforge ? > > I don't think submitting anything there helps a lot - all of us who're > likely > to be interest

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-18 Thread Daniel Stenberg
On Thu, 18 Dec 2008, Markus Moeller wrote: > Should I open a bug for this on sourceforge ? I don't think submitting anything there helps a lot - all of us who're likely to be interested enough to help solving problems are already subscribed to this mailing list. I personally still try to unders

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-18 Thread Markus Moeller
Should I open a bug for this on sourceforge ? Markus "Markus Moeller" wrote in message news:gi12or$9q...@ger.gmane.org... > The test from Alexander works. I need to check on the curl issue again. > Unfortunately the server I had the issue with isn't available at the > moment > and it didn't ha

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-14 Thread Markus Moeller
Daniel, I did run curl now with libssh2 debug and it seems to be another error than the mentioned one in libssh2-devel. [libssh2] Failure Event: -25 - Packet contains more data than we offered to receive, truncating The client is requesting in maximal 16384 bytes with SSH_FXP_READ, but receives

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-13 Thread Markus Moeller
The test from Alexander works. I need to check on the curl issue again. Unfortunately the server I had the issue with isn't available at the moment and it didn't happen always. Markus "Daniel Stenberg" wrote in message news:alpine.lrh.2.00.0812132012520.15...@yvahk3.pbagnpgbe.fr... > On Sat,

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-13 Thread Daniel Stenberg
On Sat, 13 Dec 2008, Markus Moeller wrote: (Please trim your quotes) > The server can only answer with a size which was set before by the client > (otherwise it is a server bug). As far as I understand the buffer size is > send as part of the SSH_FXP_READ request which is set in sftp.c in line

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-13 Thread Daniel Stenberg
On Sat, 13 Dec 2008, Markus Moeller wrote: > Since I experienced a similar issue when using curl with sftp I run the > sample with some debug and got to the point where in libssh2_sftp.h the > maximal packet length is defined as 4. Where does this maximum come from > ? Is it an arbitrary v

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-13 Thread Markus Moeller
Checking why the packet length is to big I found that the 4 bytes received from the server have the too big value. line 156 in sftp.c rc = libssh2_channel_read_ex(channel, 0, (char *) buffer, 4); . packet_len = libssh2_ntohu32(buffer); _libssh2_debug(session, LIBSSH2_

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-12-13 Thread Markus Moeller
Since I experienced a similar issue when using curl with sftp I run the sample with some debug and got to the point where in libssh2_sftp.h the maximal packet length is defined as 4. Where does this maximum come from ? Is it an arbitrary value or somewhere defined in the ssh/sftp protoco

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-11-27 Thread Alexander Lamaison
2008/11/27 Daniel Stenberg <[EMAIL PROTECTED]>: >> Does anyone have any ideas what might be happening? I'm afraid I haven't >> got a clue where to start debugging this. Firstly, apologies for my stupidity. The part of my previous email about the speed-up was because I forgot to call libssh2_sftp

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-11-27 Thread Daniel Stenberg
On Thu, 27 Nov 2008, Alexander Lamaison wrote: > Does anyone have any ideas what might be happening? I'm afraid I haven't > got a clue where to start debugging this. Can you provide us with the source for a full app that reproduces the problem? Preferably as small as possible, and without too

Re: [libssh2] libssh2_sftp_read() with large buffer fails

2008-11-27 Thread Alexander Lamaison
An update on my previous post: I've tried calling libssh2_sftp_read with an ever increasing buffer until it fails: for (unsigned long i = 32000; i < 600; i+=100) { cout << "trying buffer size " << i << endl; char *buf = new char[i];

[libssh2] libssh2_sftp_read() with large buffer fails

2008-11-26 Thread Alexander Lamaison
Hello everyone, I was wondering if you could help me debug a problem I'm having when using libssh2. If I try to read a file using libssh2_sftp_read with a small buffer (e.g. 4K) it works fine. However, if I try to use a large one (e.g. 6M - I think even 500K triggers the problem though) the call