Skip to content

Commit

Permalink
fix libssh2_scp_recv requires a ptr to Stat. refs: ba0f3/ssh2.nim#16
Browse files Browse the repository at this point in the history
  • Loading branch information
ba0f3 committed Feb 23, 2024
1 parent c2791ac commit f1d5bf0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/ssh_exec.nim
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ else:
if rc != 0:
echo "Authentication by public key failed!"
session.shutdown()
var channel: Channel
var channel: libssh2.Channel
while true:
channel = session.channelOpenSession()
if channel.isNil and session.sessionLastError(nil, 0, 0) == LIBSSH2_ERROR_EAGAIN:
if channel.isNil and session.sessionLastError(nil, nil, 0) == LIBSSH2_ERROR_EAGAIN:
discard waitsocket(sock.getFd(), session)
else:
break
Expand Down
4 changes: 2 additions & 2 deletions libssh2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type

Sftp* = ptr SSH2Struct
SftpHandle* = ptr SSH2Struct

SftpAttributes* {.final, pure.} = object
flags*: culong
filesize*: uint64
Expand Down Expand Up @@ -528,7 +528,7 @@ proc publickey_remove*(p: PublicKey, name, blob: cstring, blobLen: int): cint {.

proc publickey_shutdown*(p: PublicKey): cint {.ssh2.}

proc scp_recv*(s: Session, path: cstring, sb: Stat): Channel {.ssh2.}
proc scp_recv*(s: Session, path: cstring, sb: ptr Stat): Channel {.ssh2.}

proc scp_send_ex*(s: Session, path: cstring, mode, size: int, mtime, atime: int64): Channel {.ssh2.}

Expand Down
2 changes: 1 addition & 1 deletion libssh2.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Package]
name = "libssh2"
version = "0.1.6"
version = "0.1.7"
author = "Huy Doan"
description = "Nim wrapper for libssh2"
license = "MIT"
Expand Down

0 comments on commit f1d5bf0

Please sign in to comment.