[libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
Any idea how to resolve bug 1714796? http://sourceforge.net/tracker/index.php?func=detail&aid=1714796&group_id=125852&atid=703942 The correct place would be libssh2_packet_read(), but currently that function doesn't know whether we're in blocking mode or not. In blocking mode,

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread James Housley
On May 8, 2007, at 5:29 AM, Eberhard Mattes wrote: > Any idea how to resolve bug 1714796? > > http://sourceforge.net/tracker/index.php? > func=detail&aid=1714796&group_id=125852&atid=703942 > > The correct place would be libssh2_packet_read(), but currently > that function > doesn't know whethe

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
James Housley wrote: > You don't state what version this is, but there is currently major re- > writing being done in this area. The bug report states 0.15-20070413, but I think the problem is still present in the latest CVS version (haven't tried it but looked at the code). Eberhard

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
I modified sshd to send small packets and here's a trace for an instance of the bug which does not involve SFTP: [libssh2] Transport: Requesting userauth service => libssh2_packet_write plain (17 bytes) [...] => libssh2_packet_write send() (132 bytes) [...] [libssh2] Transport: Looking for packet

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
Setting blocksize = 5; in libssh2_packet_read() is not correct if multiple calls of libssh2_packet_read() are required to read a complete unencrypted packet. Suppose a packet of length 22 arrives in two parts of 20 and 2 bytes, respectively. (Ie, the first recv() call will return 20, the sec

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
libssh2_packet_read() needing at least blocksize bytes (if encryption is active) is also incorrect. Suppose we use a mac of 20 bytes and a blocksize of 16 bytes and the packet arrives in two parts, the second part containing the last 2 bytes of the mac. Now, the first libssh2_packet_read() call p

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Daniel Stenberg
On Tue, 8 May 2007, Eberhard Mattes wrote: > libssh2_packet_read() needing at least blocksize bytes (if encryption is > active) is also incorrect. Yes, you're entirely correct of course. The total read length should be no less than blocksize, but that data could of course be spread out to up to

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
Daniel Stenberg wrote: > The total read length should be no less than blocksize, but that data could > of > course be spread out to up to blocksize number of recv()s... I'm currently testing a patch which seems to solve this problem (and bug 1714796, at least for blocking mode--it might break

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
Here's my patch. What do you think? Eberhard --- transport.c.orig2007-04-18 15:19:26.0 +0200 +++ transport.c 2007-05-08 15:48:10.0 +0200 @@ -251,6 +251,7 @@ int numdecrypt; unsigned char block[MAX_BLOCKSIZE]; int blocksize; +int minimum;

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Daniel Stenberg
On Tue, 8 May 2007, Eberhard Mattes wrote: > Here's my patch. What do you think? Thanks a lot, committed! - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take cont

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
Daniel Stenberg wrote: > Thanks a lot, committed! Now bug 1714796 can be closed. Have you had a look at this patch? It fixes a bug which prevents libssh2 from working at all with a certain SSH server: http://sourceforge.net/tracker/index.php?func=detail&aid=1703473&group_id=125852&atid=703944

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Daniel Stenberg
On Tue, 8 May 2007, Eberhard Mattes wrote: > Now bug 1714796 can be closed. Grrr, I hate that bug tracker since we don't get any notifications about new submissions or anything. I see in the config that they are supposed to be sent to this list, but I figure the list config simply doesn't allow

Re: [libssh2] Blocking read returns PACKET_EAGAIN if not enough data is available?

2007-05-08 Thread Eberhard Mattes
Daniel Stenberg wrote: > Seeing that you're a massive submitter of bug reports and fine patches, > how would you think about getting CVS access to get these changes done > yourself? If my patches are fine enough...OK. Eberhard -

[libssh2] Hanging in libssh2_channel_free?

2007-05-08 Thread Cary Fitzhugh
Hello, I'm using the 0508 libssh2 snapshot with curl's snapshot from 0507. And from all that I can tell, libssh2 goes into a black hole when it tries to finish up the SFTP connection. I can see the file moved across, all the data is present, but the libssh2 debug output looks like this - and th

Re: [libssh2] Hanging in libssh2_channel_free?

2007-05-08 Thread Cary Fitzhugh
So it finally stopped - and I can see what it supposedly died on: * Failed to stop libssh2 sftp subsystem [libssh2] Transport: Disconnecting: reason=11, desc=Shutdown, lang= => libssh2_packet_write plain (21 bytes) : 01 00 00 00 0b 00 00 00 08 53 68 75 74 64 6f 77 .Shutdow 0010:

Re: [libssh2] Hanging in libssh2_channel_free?

2007-05-08 Thread Dan Fandrich
On Tue, May 08, 2007 at 04:16:02PM -0400, Cary Fitzhugh wrote: > I can?t imagine that no one has tried to upload with libssh2 over SFTP with > curl, but maybe that is the case. I?m hoping it is a configuration step I?m > missing. Test case 602 in the curl test suite tests SFTP uploads. Do you ge