Subject: Re: Hang in libssh2_sftp_readdir

Re: Hang in libssh2_sftp_readdir

From: Daniel Stenberg <>
Date: Wed, 29 Jul 2009 13:41:13 +0200 (CEST)

On Mon, 27 Jul 2009, Mike Taylor wrote:


Your comment in the patch tracker for bug #2828153 identifies my commit
b95fe985af3c80a2babcaaaf7da69a15b1237c49 as the one that breaks this for you.

While I'll be willing to simply revert that change if it unbreaks your problem
and doesn't introduce anything for anyone else, I'm still curious. 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 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 and
it would go back and do this over again.

BTW, are you using the API in blocking mode?

Received on 2009-07-29