diff options
Diffstat (limited to 'src/session.rs')
-rw-r--r-- | src/session.rs | 6 |
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 })) } } |