Ryo Nakamura
c4ea9a1e78
add ssh_buffer_new_size and ssh_buffer_add_func to libssh
...
sftp_async_write() with these functions reduces
1. realloc_buffer by ssh_buffer_new_size()
2. memcpy from read data to ssh buffer by ssh_buffer_add_func()
2022-12-06 15:02:14 +09:00
Ryo Nakamura
289293e812
change prompt for ssh key passphrase
2022-12-05 22:27:53 +09:00
Ryo Nakamura
1441873db6
reuse ctrl sftp session for the first copy thread
2022-12-05 21:47:00 +09:00
Ryo Nakamura
e1d14623f4
set TCP_NODELAY by default and introduce -N option to disable it
2022-12-04 21:32:48 +09:00
Ryo Nakamura
3b794ab51b
remove unused code and introduce -b buf_sz option
...
This commit removes ifdef ASYNC_WRITE. So, mscp always depends on
the patched libssh.
2022-12-03 20:48:43 +09:00
Ryo Nakamura
50c6781811
little cleanup
2022-12-02 23:35:45 +09:00
Ryo Nakamura
5846c6b6a9
cache passphrase for private key for later connections.
2022-12-02 23:20:23 +09:00
Ryo Nakamura
03a3a6dc4b
add auth callback for input passphrase of privkey
2022-12-02 22:28:56 +09:00
Ryo Nakamura
03b857b51a
add -M hmac option
2022-12-02 21:13:13 +09:00
Ryo Nakamura
d646fc1f89
use sigalrm for printing progress bar
2022-11-28 00:14:05 +09:00
Ryo Nakamura
5188cf6df6
add ETA to progress print
2022-11-27 20:36:24 +09:00
Ryo Nakamura
130e735e65
skip sftp_free() inappropriately
2022-11-27 19:48:13 +09:00
Ryo Nakamura
db1431ed6a
only the last thread changes dst file permission
2022-11-27 00:06:39 +09:00
Ryo Nakamura
8cc964ca8a
fix duplicate error message on ssh auth failed.
...
and fix the final \n with -q
2022-11-26 17:34:24 +09:00
Ryo Nakamura
dca0241824
add O_TRUNC when the first open() for a file
2022-11-18 22:30:34 +09:00
Ryo Nakamura
f4d04b848e
don't stop on macos whem -m coremask is set
2022-11-18 22:24:46 +09:00
Ryo Nakamura
04ae5ee1dc
remove pr_warn debug
2022-11-18 21:52:58 +09:00
Ryo Nakamura
71efeaa4ba
fix type of id for sftp_async_write
2022-11-18 20:33:50 +09:00
Ryo Nakamura
5e7aa774ca
fix when copy multiple sources and various tiny fixes
...
* when copying multiple sources, target must be directory
* add multi-src copy test and parametrize src/dst prefixes
* cleanup REAMDE (s/sessions/connections/g)
* make error output in copy functions simple
2022-11-18 20:20:19 +09:00
Ryo Nakamura
b8d58b1fba
tiny fix
...
- set ssh nonblocking before closing sftp session
- fix pprint for core mask
2022-11-18 13:47:24 +09:00
Ryo Nakamura
5ede4dc122
fix async handling
2022-11-17 23:46:51 +09:00
Ryo Nakamura
2d66f4ca14
fix idx increment (typo) and async write improves copy speed!
2022-11-17 22:09:59 +09:00
Ryo Nakamura
d448f9eb8a
implement local-to-remote copy with async_write
2022-11-17 21:46:21 +09:00
Ryo Nakamura
41da0c5cfe
check invalid coremask
2022-11-16 01:57:27 +09:00
Ryo Nakamura
a69115a4dc
add -m coremask option
2022-11-15 19:57:53 +09:00
Ryo Nakamura
e9d5ceb462
add memory barrier to notify monitor thread of copy threads finished
2022-11-13 15:33:45 +09:00
Ryo Nakamura
81a7fbd2d8
add -a nr_ahead option
2022-11-13 15:31:12 +09:00
Ryo Nakamura
cfbbae860c
little trick to make progress bar stable
2022-11-12 17:45:08 +09:00
Ryo Nakamura
756e0759f9
fix buf size in remote to local copy.
...
Too large buffer size for sftp_async_read causes unfinished copy:
sftp_async_read returns 0 althrough data remains.
2022-11-12 17:30:51 +09:00
Ryo Nakamura
71d827d613
fix some thread handling
2022-11-12 16:11:20 +09:00
Ryo Nakamura
73e884f9c5
use sftp_async_read for remote to local copy
2022-11-12 15:30:01 +09:00
Ryo Nakamura
8eb9e69c1c
fix incorrect ret handling for read/write
2022-11-08 10:06:30 +00:00
Ryo Nakamura
243bf1fa57
add -H option to disable host key check
...
tests use this option.
2022-11-05 22:46:02 +09:00
Ryo Nakamura
6e6e5066c7
create file at the remote although file size is 0
2022-11-05 19:13:53 +09:00
Ryo Nakamura
d62fc2cddd
do not print progress when total bytes transferred is 0
2022-10-31 15:30:42 +00:00
Ryo Nakamura
7039b84c4f
capture retval from copy threads
2022-11-01 00:17:05 +09:00
Ryo Nakamura
44ed580f4d
add rename-logic.py
2022-10-31 22:55:43 +09:00
Ryo Nakamura
926688e849
rename dirname if dst dir does not exist
...
`scp remote:srcdir dstdir` renames srcdir to dstdir if dstdir does
not exist. If dstdir exists, it creates dstdir/srcdir.
This commit imitates this behavior.
2022-10-31 22:51:39 +09:00
Ryo Nakamura
e997d692c2
set nr_threads to # of chunks if # of chunks is small
2022-10-30 12:27:58 +00:00
Ryo Nakamura
453e8f27ce
add cpack to build debian package
2022-10-30 12:17:17 +00:00
Ryo Nakamura
96c10a700a
fix on debug compile
2022-10-30 07:41:49 +00:00
Ryo Nakamura
b9f44bb030
Merge branch 'main' of github.com:upa/mscp
2022-10-30 15:22:17 +09:00
Ryo Nakamura
c495f6b89b
rename sscp to mscp
2022-10-30 15:20:05 +09:00
Ryo Nakamura
65bdbdaede
little refactoring for param names
2022-10-30 06:13:02 +00:00
Ryo Nakamura
5d848ccab1
fix int overflow
2022-10-30 05:47:21 +00:00
Ryo Nakamura
37c37990f5
use sftp_get_ssh_error
2022-10-30 00:02:21 +09:00
Ryo Nakamura
c76fa3141d
change indent from space to tab
2022-10-29 23:48:50 +09:00
Ryo Nakamura
ff697aa514
fix path handling
2022-10-29 23:36:12 +09:00
Ryo Nakamura
47f6983148
wrap print progress in pprint
2022-10-25 01:47:39 +09:00
Ryo Nakamura
c83927cd5a
add copy start and done output
...
These fputs should be wrapped in a function and protected by a lock. todo.
2022-10-25 00:14:47 +09:00