Subject: Re: BUG: libssh2_channel_read() does not handle files with size = 0 correctly

Re: BUG: libssh2_channel_read() does not handle files with size = 0 correctly

From: Uli Zappe <uli_at_ritual.org>
Date: Wed, 6 Oct 2010 22:55:10 +0200

Am 06.10.2010 um 22:34 schrieb Daniel Stenberg:

>> there's a bug in libssh2_channel_read() that makes it return LIBSSH2_ERROR_EAGAIN instead of 0 when a file of size 0 is to be copied (using the code of the scp_nonblock.c example). As a result, scp times out instead of immediately returning normally after copying a remote file with size 0. (Lock files are a real world example of files with size 0.)
>
> Is this testet with the current git?

No, that was with the latest release version, libssh2-1.2.7.

> I just tried, and I can't repeat this problem...! I scp a zero byte file from localhost, and scp_nonblock reports:
>
> libssh2_scp_recv() is done, now receive data!
> Got 0 bytes in 134 ms = 0.0 bytes/sec spin: 0

Hm, this looks indeed correct. I'm currently out of town, so unfortunately I can't test it right now, but I could try a few weeks from now.

            Bye
                    Uli
________________________________________________________

  Uli Zappe, Solmsstraße 5, D-65189 Wiesbaden, Germany
  http://www.ritual.org
  Fon: +49-700-ULIZAPPE
  Fax: +49-700-ZAPPEFAX
________________________________________________________

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-10-06