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

Allow request_exec with async I/O and more #576

Merged
merged 8 commits into from
Feb 6, 2024
Merged

Commits on Feb 6, 2024

  1. Add low level call to request_exec and send_eof

    To allow asynchronous handling of the execution.
    pbrezina committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    7b8ba12 View commit details
    Browse the repository at this point in the history
  2. Add direct call to request_send_signal

    OpenSSH now supports receiving signals for a long time. This is
    useful when you need to communicate with a process via signals.
    pbrezina committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    dadb7dd View commit details
    Browse the repository at this point in the history
  3. Handle EOF in recv_nonblocking

    If recv_nonblocking is called and the ssh command ended with EOF
    and empty output, the following error is produced because nbytes ==
    SSS_EOF == -127:
    
    ```
    File "src/pylibsshext/channel.pyx", line 112, in pylibsshext.channel.Channel.read_nonblocking
    SystemError: Negative size passed to PyBytes_FromStringAndSize
    ```
    
    It is better to handle it gracefully.
    pbrezina committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    6d13cfe View commit details
    Browse the repository at this point in the history
  4. Add direct call to is_eof

    When doing asynchronous I/O it is usefull to know when EOF is hit
    after polling for data.
    pbrezina committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    0b1a5ea View commit details
    Browse the repository at this point in the history
  5. Keep reference of Session in Channel

    It may happen that a garbage collector collects Session object befor
    unclosed Channel. Then Channel's destructor tries to close the channel,
    libssh session is accessed but it is already freed, thus causing
    segfault.
    
    Keeping reference to the Session object makes sure that Session
    is collected after Channel.
    pbrezina committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    b78f404 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0b9111f View commit details
    Browse the repository at this point in the history
  7. Add changelog fragments

    pbrezina committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    4d1df86 View commit details
    Browse the repository at this point in the history
  8. tests: fix random timeout when connecting to ssh

    Previous implementation of wait_for_svc_ready_state was not robust
    enough as it could return even if further ssh connections kept failing.
    pbrezina committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    376fc52 View commit details
    Browse the repository at this point in the history