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

Windows fix for session_handshake #70

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

Conversation

BernardoGomesNegri
Copy link

Fix for session_handshake on Windows. The "if windows, if x64, unsigned 64 bit, else unsigned 32 bit, else signed 32 bit" logic was being repeated in a few places (and I had to add it to another place) so I decided to move it into an alias. c2hs does not know the alias can be converted to what it aliases to, so specifying the id function as a marshaller works (since Haskell knows how to unalias).
I was able to list a directory on my machine using login/password authentication and sftp, which probably means it is all working fine.

Dropped dependency on "unix" in Windows (library compiles fine without it), new "MachineSock" type alias that aliases to whatever ssh2socket returns, session_handshake accepts that.
session_handshake in libssh2 takes a libssh2_socket_t, which in Windows is an SOCKET, and otherwise is a signed int.
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