Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh2_poll's parameter timeout should not * 1000 #78

Open
mingyuantech opened this issue May 15, 2024 · 1 comment
Open

ssh2_poll's parameter timeout should not * 1000 #78

mingyuantech opened this issue May 15, 2024 · 1 comment

Comments

@mingyuantech
Copy link

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
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants