Ticket #56 (closed defect)

Opened 10 years ago

Last modified 9 years ago

libssh2_poll handles -1 timeout incorrectly

Reported by: apjenkins Owned by: bagder
Priority: normal Milestone:
Component: API Version:
Keywords: Cc: apjenkins, bagder
Blocked By: Blocks:


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.

Change History

comment:1 Changed 10 years ago by bagder

That'd be great!

comment:2 Changed 9 years ago by sf-robot

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

Note: See TracTickets for help on using tickets.