Subject: Re: Hang in libssh2_sftp_readdir

Re: Hang in libssh2_sftp_readdir

From: Peter Stuge <peter_at_stuge.se>
Date: Wed, 29 Jul 2009 16:10:50 +0200

Daniel Stenberg wrote:
> Why does libssh2 need to keep reading from the socket even though
> it did a short read and thus then knows that there's no more
> pending data to read?

I think this assumption is the problem - recv() can return early just
like write().

> I agree that there's potentially more data to read in the next
> invoke of the function, but then poll() or select() would also
> simply return immediately

Are you sure? I am not. Also, are they really called in a loop?

The error sure feels like libssh2 isn't consuming all the data it can
and should.

I am not sure simply reverting the patch is correct either. :\

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-07-29