Ryo Nakamura
d6f437bcb1
change thread_list to thread_pool
2024-02-11 14:11:47 +09:00
Ryo Nakamura
bfc955a9a7
change path_list to path_pool
2024-02-11 14:11:47 +09:00
Ryo Nakamura
d2e061fd97
add pool strcture and move src list to pool
2024-02-11 14:08:56 +09:00
Ryo Nakamura
f8f8cf1994
remove unnecessary \n
2024-02-07 16:58:17 +09:00
Ryo Nakamura
b2628b54fb
add -4 and -6 options to use either IPv4 or IPv6
2024-02-07 15:14:27 +09:00
Ryo Nakamura
96084004b6
cleanup error message handling
...
The top-level funtion in a thread should print errors using
priv_get_err(), while lower-level functions should set error messages
using priv_set_err() except that error mesesages should be printed
immediately, e.g., under walk_src_path().
2024-02-07 13:29:45 +09:00
Ryo Nakamura
93f155cffe
add .clang-format from Linux kernel and format sources
...
The exception is that ColumnLimit is 90.
2024-02-06 23:09:59 +09:00
Ryo Nakamura
4f0669f8f8
refactor error message-related functions
...
split message print fuctions (mpr_*), strerrno, and mscp_get/set_error
into print.c/h and strerrno.c/h.
ToDo: revise usages of priv_set_errv and pr_* functions.
2024-02-06 21:54:04 +09:00
Ryo Nakamura
a7f8ad948b
add -p option, preserving file timestamps
2024-02-06 16:15:43 +09:00
Ryo Nakamura
ff45d9d71b
add two env vars to pass password/keyphrase ( #9 )
...
MSCP_SSH_AUTH_PASSWORD passes a password, and MSCP_SSH_AUTH_PASSPHRASE
passes a passphrase for publickey auth. They enable avoiding interactive
password input. Test cases are also added.
2024-02-06 10:35:38 +09:00
Ryo Nakamura
9908fb309d
passing options via pointers in mscp_ssh_opts
...
We do not need static buf because we have already dropped python biding
support.
2024-02-05 23:36:59 +09:00
Ryo Nakamura
c95e6a4fff
do not passing msg_fp via mscp opts
...
instead, mpr_* functions print messages to stdout or stderr directly.
2024-02-04 20:23:08 +09:00
Ryo Nakamura
d57ed4149d
drop python binding support
2024-02-04 16:18:27 +09:00
Ryo Nakamura
7ab5cc3ce9
make it buildable at FreeBSD
2024-01-21 04:50:34 +09:00
Ryo Nakamura
9bdbfe8487
add SPDX-License-Identifier to source files
2024-01-18 12:59:49 +09:00
Ryo Nakamura
bba53fab03
don't allocate char[PATH_MAX] for each file
...
This commit makes struct path allocation use strndup().
It reduices the memory footprint for struct path per file (issue #8 ).
2024-01-18 12:59:49 +09:00
Ryo Nakamura
5cbf3ad648
fix wrong dst path for source path under '/'
...
When a source file path is /FILE, its dest path would be dst/ILE.
This commit fixes this issue (#8 ).
2024-01-18 12:59:49 +09:00
Ryo Nakamura
68a8f3724f
print warn messages when stat and opendir failed
...
during scanning src paths due to, e.g., too many levels of
symbolic links, too long path, and permission deineid.
2024-01-18 12:59:48 +09:00
Ryo Nakamura
2b71c4bf8c
add -P, equivalent to -p for just compatibility
...
and add a test case for -p and -P
2023-11-25 15:49:09 +09:00
Ryo Nakamura
0cf3acee20
add -I interval option
...
-I INTERVAL option inserts sleep for interval (seconds) between
SSH connection attempts (issue #7 ).
2023-11-25 15:17:33 +09:00
Ryo Nakamura
8e590da322
fix parsing user@host:path.
...
This commit fixes issue #6 . Now mscp command correctly parses
[x::x] IPv6 address notation in hostname.
2023-11-01 19:54:18 +09:00
Ryo Nakamura
b298b2ec35
main: adopt rolling average of recent eight bps values to calculate ETA
2023-11-01 19:54:18 +09:00
Ryo Nakamura
05a7e96759
main: call only mscp_stop() when receives sigint
2023-11-01 19:54:18 +09:00
Ryo Nakamura
139ba12f1a
write total transferred bytes and number of files
...
at the end of output when serverity is notice.
2023-11-01 19:54:18 +09:00
Ryo Nakamura
cfbadebe6d
change msg: thread[%d] to thread:%d
2023-11-01 19:54:18 +09:00
Ryo Nakamura
d7365683a9
print 1st decimal point in the progress bar
2023-11-01 19:54:18 +09:00
Ryo Nakamura
bf74aa095a
add -g option to specify TCP cc algorithm
...
This commit introduce SSH_OPTIONS_CCALGO option to the libssh patch
and add -g CONGESTION option to mscp.
2023-11-01 19:54:18 +09:00
Ryo Nakamura
72841ec12d
fix: use off_t for lseek
2023-09-08 17:19:13 +09:00
Ryo Nakamura
11e024c1da
fix libmscp python bindings.
...
- fix libmscp install path by setup.py with data_files
- fix return values of mscp_get_stats()
- add examples directory for mscp python binding
2023-08-30 21:24:00 +09:00
Ryo Nakamura
13ec652195
fix mscp_opendir, do not use tls_sftp, use sftp isntead.
...
The fixed issue causes mscp_opendir wrongly calls opendir() for
local when tls_sftp is NULL although sftp is not NULL.
2023-08-30 19:09:29 +09:00
Ryo Nakamura
58026790d9
fix usage: "none" is not supported for -F
2023-08-04 16:11:29 +09:00
Ryo Nakamura
23d9577bde
introduce git-based versioning
...
MSCP_BUILD_VERSION (`git describe --tags --dirty --match "v*"`) is
passed through include/mscp_version.h.in and cmake.
When git is failed, use VERSION file instead (for building from
source tar balls that excludes .git).
2023-08-04 16:07:37 +09:00
Ryo Nakamura
24c1bc9149
do not set O_TRUNC when opening destination file.
...
It prevents `mscp localhost:hoge ~/hoge` from truncating the source
file. See https://bugzilla.mindrot.org/show_bug.cgi?id=3431 .
https://github.com/upa/mscp/issues/1
2023-08-04 15:06:14 +09:00
Ryo Nakamura
518aa42208
add -F ssh_config option
2023-08-04 13:31:10 +09:00
Ryo Nakamura
fbc817213b
use pseudo glob/globfree for remote-glob when musl
...
musllibc does not implement GLOB_ALTDIRFUNC, so do not call
glob for remote sides when libc is musl.
test_e2e.py skips test_glob_src_path when running on alpine.
2023-08-03 21:59:54 +09:00
Ryo Nakamura
ba6f53d253
add glob for source paths
...
https://github.com/upa/mscp/issues/3
2023-08-03 20:26:13 +09:00
Ryo Nakamura
9f7c135b15
cleanup wrappers for file operations
...
Previously wrapper functions for open(), opendir(), and stat(), etc,
are implemneted in path.h, and now they are in fileops.h and fileops.c.
This commit is a reparation for remote glob.
2023-08-03 17:07:39 +09:00
Ryo Nakamura
24e86f58d8
mscp: maintain mscp_thread structs in list
...
Instead of m->threads array, struct mscp_thread instanes are
maintained in m->thread_list. This enables stable counter access
via mscp_get_stats().
2023-05-07 21:05:05 +09:00
Ryo Nakamura
1d3b3a2261
main: add a white space to the elapsed time output
...
It adjusts the position of XX:XX in elapsed timeou output.
2023-04-05 19:07:10 +09:00
Ryo Nakamura
575c920b6e
main: print elapsed time instead ETA at the end
2023-04-05 19:00:29 +09:00
Ryo Nakamura
1bd832a135
Merge branch 'main' of github.com:upa/mscp
2023-03-26 01:50:00 +09:00
Ryo Nakamura
834407379d
fix error handling when scan thread failed.
...
set chunk pool to fill to invoke copy threads when scan failed.
2023-03-25 22:29:09 +09:00
Ryo Nakamura
8192151154
fix invalid return sem
2023-03-22 18:06:19 +09:00
Ryo Nakamura
e0e6fae296
do not sem_close() for unnamed semaphore
2023-03-16 01:01:46 +09:00
Ryo Nakamura
6305f02770
fix semaphore handling for macOS
2023-03-16 00:03:22 +09:00
Ryo Nakamura
ae4b848ba0
add sem_create(), wrappign sem_init() for linux and sem_open() for macOS
2023-03-15 23:54:57 +09:00
Ryo Nakamura
3902fb584a
linux also needs stdlib.h for random()
2023-03-15 23:26:11 +09:00
Ryo Nakamura
f0c70a148b
macOS does not support sem_init. use sem_open instead
2023-03-15 23:18:33 +09:00
Ryo Nakamura
f5d0f526f2
add comment to mscp_scan(), why usleep(100)
2023-03-15 22:19:09 +09:00
Ryo Nakamura
a086e6a154
rename mscp_prepare to mscp_scan
2023-03-15 22:03:14 +09:00