Subject: timeouts in libssh2 blocking-mode

timeouts in libssh2 blocking-mode

From: Matt Lilley <>
Date: Mon, 02 May 2011 17:27:50 +1200


We've been using libssh2 for a while in some internal tests. It
generally works very well, but there's an annoying problem where badly
behaved ssh servers can cause lockups inside libssh2. Jan Van Boghout
posted some patches to implement a simple workaround for this last year
and I see there's a bug ( for it as
well, currently partially complete but not fully integrated (and now
almost a year old)

I've attached an updated patch against the tip of the master git
repository which preserves the recently added keepalive support, while
ensuring in the end we don't block forever. While the keepalive support
works very well after the session is established, until that point, it
seems that sending keepalives will cause the server to boot us off; that
means we are exposed to potential endless blocking during a session

Since I'm new to the mailing list, I may have missed recent discussion,
but the bug hasn't really moved in a year, so I thought it might be
worth reinvorigating debate - comments very welcome.


Matt Lilley
Software Engineer
Tel:    +64 4 912-2100
Fax:    +64 4 912-2101
This e-mail has passed our content security scan.
It is covered by the confidentiality clauses at
Received on 2011-05-02