Subject: Re: timeouts in libssh2 blocking-mode

Re: timeouts in libssh2 blocking-mode

From: Matt Lilley <matt.lilley_at_securitease.com>
Date: Tue, 03 May 2011 08:12:59 +1200

> I'm happy to commit this. I would like to touch up the commit message
> slightly however. In particular it should include some variation of
> "fixes #160" so that the ticket gets closed.
>
>
> //Peter
Ok, that sounds fine to me. Daniel has commented that he'd prefer the
timeout to be the maximum time that any libssh2 function can remain
blocked, which I agree would be nice, but I'm not sure how to implement
- I guess each entry point could reset a counter, and then the recv()
could have a 1 second timeout, which increments this counter until it
reaches the specified limit, at which point the function returns with a
timeout error. This is a lot of work though; every function would have
to be modified (or perhaps the BLOCK_ADJUST macro?) and I'm not sure
there are significant gains - after all, the keepalive code does
something similar to this. All I want is a safety net to prevent our
application locking up when it connects to an ssh server that we have no
administrative control over.

If I've missed some simple way of achieving Daniel's approach, feel free
to point it out to me, and if I understand, I can have a go at
implementing it.

Matt

-- 
_____________________________________________
Matt Lilley
Software Engineer
SecuritEase
Tel:    +64 4 912-2100
Fax:    +64 4 912-2101
E-mail: matt.lilley_at_securitease.com
Web:    http://www.securitease.com
_____________________________________________
This e-mail has passed our content security scan.
It is covered by the confidentiality clauses at http://www.securitease.com/content_and_confidentiality
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-05-02