Subject: Re: [PATCH] Timeout support for blocking API

Re: [PATCH] Timeout support for blocking API

From: Daniel Stenberg <>
Date: Mon, 14 Jun 2010 14:59:20 +0200 (CEST)

On Thu, 10 Jun 2010, Jan Van Boghout wrote:

> The goal of the patch was to time out properly when a connection becomes
> unresponsive. As it is, libssh2 sometimes just blocks indefinitely waiting
> for the server to respond -- causing the host app to block its libssh2/SFTP
> thread as well and making proper higher-level timeout handling impossible.
> If the server is still responding, the timeout should indeed just cause it
> to loop back, which is desirable behavior in our case (reading/writing for
> SFTP).

But the question is: what exactly is the time you specify?

In your patch, it becomes the longest time select() will ever wait for action,
but is that really the time a user wants to specify? Won't a user rather want
to specify the longest time a particular libssh2 function is allowed to wait
or similar?

Received on 2010-06-14