ba0f3 / ssh2.nim

Async SSH, SCP and SFTP client for Nim, using libssh2 wrapper [WIP]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scp: fail to write data: 997 wrote, 1024 expected

sage-bekti opened this issue · comments

i got error "scp: fail to write data: 997 wrote, 1024 expected" while i using scp. but, when i using sftp it's ok.
Capture

what is your ssh server? any error message on server side?

i tried to send file to router. on the router log like this "Tue Jul 27 20:29:39 2021 authpriv.info dropbear[26329]: Exit (root): Disconnect received". my router is openwrt.

file upload/download work with dropbear on openwrt on my router

OpenWRT 18.06.5
Dropbear v2017.75

make sure your dropbear built w/ scp capacity.

im using OpenWrt 15.05.1 and Dropbear v2015.67.
for upload data its done. i fix it with adding code in below.
from
f = open(localPath, fmRead)
to
f = open(localPath, fmRead, buffer.len)
in file scp.nim line 27

but the problem appears when i use download. I use the original download function that has been provided.
in this code
channel = scp.session.scp_recv2(remotePath, addr stat)

we know if that function fill stuct of stat
but, after i collect the value of it.
like this
echo stat.st_dev
echo stat.st_ino
echo stat.st_mode
echo stat.st_nlink
echo stat.st_uid
echo stat.st_gid
echo stat.st_rdev
echo stat.st_size

the output is :
0
0
384
0
0
0
0
0

so i assumed it not collect properly. can you help me?

I will check it soon