Ticket #56 (closed defect)
libssh2_poll handles -1 timeout incorrectly
|Reported by:||apjenkins||Owned by:||bagder|
The documentation for libssh2_poll says the semantics are like poll(2). However poll(2) accepts a -1 timeout, which means to wait indefinitely. libssh2_poll does not correctly handle a -1 timeout. It seems like the only way to indicate an indefinite wait is to pass a really large timeout to libssh2_poll. I think either the documentation should mention that libssh2_poll differs from poll(2) in this way, or a -1 timeout should be supported as meaning wait indefinitely.
Currently, if you look in libssh2_poll code, it performs arithmetic on timeout_remaining without first checking to see if it's negative. I can submit a patch to make libssh2_poll support -1 like poll(2) if you'd like.