Subject: Re: [libssh2] libssh2_sftp_close_handle: how to handle errors

Re: [libssh2] libssh2_sftp_close_handle: how to handle errors

From: Daniel Stenberg <>
Date: Tue, 1 Jul 2008 22:22:38 +0200 (CEST)

On Tue, 1 Jul 2008, J.T. Conklin wrote:

> I checked the current CVS version of sftp.c, and it looks like more effort
> has been made to make libssh2_sftp_close_handle() return PACKET_EAGAIN when
> an underlying libssh_* operation fails with PACKET_EAGAIN. I'm not sure
> what benefit this is supposed to provide. It seems to push error handling
> for nonblocking connections up to the client, so what was a
> "libssh2_sftp_close_handle(h);" has to be changed to
> "while(libssh2_sftp_close_handle(h) != PACKET_EAGAIN);".
> I really think this libssh2_sftp_close_handle() needs to be changed
> to be best effort and blocking

Why so? We've made an effort to bring non-blocking functionality to libssh2,
why would an application using libssh2 suddenly not care about that when it
wants to close a SFTP handle?

I don't consider dealing with "blockiness" to be exactly error-handling.

I would however consider your version to be true if the socket is set to
blocking mode.

Sponsored by: Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at
libssh2-devel mailing list
Received on 2008-07-01