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

Extend the writing and waiting functions #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

fmang
Copy link
Collaborator

@fmang fmang commented May 22, 2023

This merge request add new methods for writing data into the standard input of the remote process. It also fixes and extend the wait loops in order not to consume all the CPU like it did, and allows the caller to specify a block to be called at regular intervals instead of losing all the control.

fmang added 6 commits May 18, 2023 15:47
Channel#read_stream catches EAGAIN errors, so the blocking_call wrapper was
useless. On the other hand, the loop must perform a waitsocket to compensate
for the lack of waiting from read_stream. Otherwise, the loops made the CPU run
at full throttle.

The native call to libssh2_channel_read_ex passed the size of the pointer
instead of the size of the buffer to libssh2, making it always return tiny
amounts of data. The allocated buffer was also never freed, so I use the stack
instead.
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

Successfully merging this pull request may close these issues.

1 participant