php / pecl-networking-ssh2

Bindings for the libssh2 library
http://pecl.php.net/package/ssh2
Other
51 stars 58 forks source link

ssh2_poll's parameter timeout should not * 1000 #78

Open mingyuantech opened 2 months ago

mingyuantech commented 2 months ago

line: 942 -> fds_ready = libssh2_poll(pollfds, numfds, timeout * 1000);

An error in this location makes it impossible to determine if the session was forcibly disconnected remotely.

line: 942 -> fds_ready = libssh2_poll(pollfds, numfds, timeout);

langemeijer commented 2 months ago

Although libssh2_poll() doesn't specify the timeout resolution, from the code I conclude that it must be in milliseconds, because it gets passed to poll():

The timeout argument specifies the number of milliseconds that poll() should block

The extension function ssh2_poll() has a timeout parameter specified in seconds.

The seconds timeout parameter from the php function when passed to libssh2 is multiplied by 1000 to get the number of milliseconds. I see no problem here, what am I missing?