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

Enhancement: libssh2_channel_direct_streamlocal #40

Open
imgurbot12 opened this issue Sep 27, 2018 · 2 comments
Open

Enhancement: libssh2_channel_direct_streamlocal #40

imgurbot12 opened this issue Sep 27, 2018 · 2 comments

Comments

@imgurbot12
Copy link

I noticed this has been added recently added to the libssh2 library and was wondering if it could be wrapped and accessible through this as well.

Here is the pull request to show the changes in libssh2: libssh2/libssh2#216

I have never worked with cpython before, otherwise i would make a pull request with the changes myself but i imagine the code in session.pyx would look something like this:

def channel_direct_streamlocal(self, socket_path not None, shost not None, int sport):
        cdef c_ssh2.LIBSSH2_CHANNEL *channel
        cdef bytes b_shost = to_bytes(shost)
        cdef bytes b_socket_path = to_bytes(socket_path)
        cdef char *_shost = b_shost
        cdef char *_socket_path = b_socket_path
        with nogil:
            channel = c_ssh2.libssh2_channel_direct_streamlocal(
                self._session, _socket_path, _shost, sport)
        if channel is NULL:
            return handle_error_codes(c_ssh2.libssh2_session_last_errno(
                self._session))
        return PyChannel(channel, self)

Thanks

@pkittenis
Copy link
Member

pkittenis commented Oct 3, 2018

Hi there,

Thanks for the interest and report.

It can be added after the pull request has been accepted and merged into libssh2, yes. It has not been merged yet - depends on libssh2/libssh2#216

The implementation looks ok more or less (indentation) if you want to make a PR for when it is merged into libssh2.

@enkore
Copy link
Member

enkore commented Nov 10, 2023

PR has been merged: libssh2/libssh2#945

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

No branches or pull requests

3 participants