summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWez Furlong <wez@wezfurlong.org>2019-07-29 14:03:34 -0700
committerWez Furlong <wez@wezfurlong.org>2019-07-31 14:21:50 -0700
commit3aa8096bc4e1c6c762f8553c516b5ce099ba5f71 (patch)
tree87daf4fefb6814697e8ac7309e5892456cfc7e6b /src
parentff790796728ed74ff29cded408622117ebf0e64f (diff)
downloadssh2-rs-3aa8096bc4e1c6c762f8553c516b5ce099ba5f71.zip
Fix scp_recv ABI issue on Windows
* Adopt scp_recv2 instead, which uses compatible 64-bit stat types * Mark scp_recv as deprecated * small version bump Fixes https://github.com/alexcrichton/ssh2-rs/issues/109 Refs https://github.com/alexcrichton/ssh2-rs/pull/117 Co-authored-by: Joyce Babu <joyce@ennexa.com>
Diffstat (limited to 'src')
-rw-r--r--src/session.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/session.rs b/src/session.rs
index 3ae3473..bce81ad 100644
--- a/src/session.rs
+++ b/src/session.rs
@@ -533,8 +533,8 @@ impl Session {
pub fn scp_recv(&self, path: &Path) -> Result<(Channel, ScpFileStat), Error> {
let path = try!(CString::new(try!(util::path2bytes(path))));
unsafe {
- let mut sb: libc::stat = mem::zeroed();
- let ret = raw::libssh2_scp_recv(self.inner.raw, path.as_ptr(), &mut sb);
+ let mut sb: raw::libssh2_struct_stat = mem::zeroed();
+ let ret = raw::libssh2_scp_recv2(self.inner.raw, path.as_ptr(), &mut sb);
let mut c = Channel::from_raw_opt(ret, &self.inner)?;
// Hm, apparently when we scp_recv() a file the actual channel
@@ -543,7 +543,7 @@ impl Session {
// artificially limit the channel to a certain amount of bytes that
// can be read.
c.limit_read(sb.st_size as u64);
- Ok((c, ScpFileStat { stat: sb }))
+ Ok((c, ScpFileStat { stat: *sb }))
}
}