Commit Graph

243 Commits

Author SHA1 Message Date
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
5ac0874621 bump version to 0.0.8 v0.0.8 2023-03-19 16:41:15 +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
4ec877a290 test: add __repr__ to File 2023-03-15 23:23:14 +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
e038b3020d fix readme 2023-03-15 22:28:23 +09:00
Ryo Nakamura
2fdfa7b830 test: add invalid kwargs test 2023-03-15 22:20:00 +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
Ryo Nakamura
3bce4ec277 set m->tid_prepare 0 to avoid duble join 2023-03-15 21:56:46 +09:00
Ryo Nakamura
a923d40ada mscp: add -u max_startups option.
pymscp also accepts keyword 'max_startups' (int).
2023-03-15 21:53:34 +09:00
Ryo Nakamura
24fef5f539 fix: when msg_fd is 0, use STDOUT_FILENO 2023-03-15 01:35:55 +09:00
Ryo Nakamura
4e80b05da7 do not fdopen(msg_fd) if msg_fd < 0 2023-03-15 00:39:56 +09:00
Ryo Nakamura
98eca409af introduce semaphore for concurrent connecting ssh
instead of ssh_estab_queue (delay-based approach). MaxStartups in
sshd_config limits number of conccurent incoming ssh connections.
mscp_opts->max_startups adjusts this value.
2023-03-15 00:35:48 +09:00
Ryo Nakamura
cf99a439cb cleanup message print functions 2023-03-15 00:00:23 +09:00
Ryo Nakamura
3077bb0856 rename ssh_connect_flag to ssh_estab_queue 2023-03-14 01:20:55 +09:00
Ryo Nakamura
72c27f16d6 implement ssh_connect_flag
Each copy thread establishes SSH/SFTP connection to remote host.
A delay is inserted between SSH connecting to the remote.
2023-03-14 00:43:53 +09:00
Ryo Nakamura
9b0eb668f9 cleanup mscp_prepare-related code 2023-03-14 00:11:13 +09:00
Ryo Nakamura
5f9f20f150 mscp_prepare() scans source paths in a thread.
This commit runs mscp_prepare() in a pthread. mscp copy threads
run aysnchronously with mscp_prepare(). So, when mscp_prepare()
has not finished yet (due to too many source files), we can start
to copy files.
2023-03-13 22:35:51 +09:00
Ryo Nakamura
ceb9ebd5a8 revise walk_src_path.
In new walk_src_path, resolve dst path and resolve chunks are
invoked when adding a path.
2023-03-13 21:02:26 +09:00
Ryo Nakamura
3810d6314d Update README.md 2023-03-13 15:37:56 +09:00
Ryo Nakamura
09d7ec6a24 bump version to 0.0.7 v0.0.7 2023-03-13 15:01:44 +09:00
Ryo Nakamura
cafbefe48c fix mscp.py 2023-03-13 14:53:54 +09:00
Ryo Nakamura
631d52b00d fix install libmscp.dylib to python package dir in macOS 2023-03-13 14:46:04 +09:00
Ryo Nakamura
6e17d0ddbc remove VERSION from package file names
This change enables downloading latest packages from URL
https://github.com/upa/mscp/releases/latest/download/PACKAGE
2023-03-12 23:01:06 +09:00
Ryo Nakamura
e2da5811ce test: add test_python.py for testing python-mscp
Dockerfiles also adapt themselvs for testing python-mscp bindings.
2023-03-12 20:37:57 +09:00
Ryo Nakamura
597a7a8cba little cleanup for python bindings 2023-03-12 17:39:51 +09:00
Ryo Nakamura
2416b5f182 fix cleanup 2023-03-12 17:06:02 +09:00
Ryo Nakamura
1028ecb53b setup.py: read version from VERSION file 2023-03-12 13:21:19 +09:00
Ryo Nakamura
d15a25d1f6 add destructor to mscp class to call mscp_free() 2023-03-12 00:17:11 +09:00
Ryo Nakamura
10812071aa mscp copy via python bindings works.
ToDo: memory for struct instance in pymscp.c is not released until
mscp.free() is called. It is memory leak in a typical pyhotn usage.
Use python extension refcnt instead.
2023-03-12 00:05:39 +09:00
Ryo Nakamura
8ea05729c2 add mscp and pymscp python modules.
pymscp is a C Python wrapper for libmscp functions. mscp module
provides simple (?) Python API.
2023-03-11 22:49:19 +09:00
Ryo Nakamura
855ee618a6 add note to mscp_cleanup() and mscp_free()
mscp_join() must be called before mscp_cleanup() and mscp_free()
are called. Need fix.
2023-03-11 22:11:44 +09:00
Ryo Nakamura
74d58e986a move direction from mscp_opts to mscp_init argument 2023-03-11 21:48:07 +09:00
Ryo Nakamura
7e7bc61ff2 start to implement pymscp.c 2023-03-11 20:54:45 +09:00
Ryo Nakamura
d22c02b793 remove numpy from test, and fix compiling single binary mscp 2023-03-10 22:07:07 +09:00
Ryo Nakamura
2477647a3b fix uninitialized dst_path_is_dir bool 2023-03-10 21:42:00 +09:00
Ryo Nakamura
e037294d3d add include GNUInstallDirs 2023-03-10 21:11:59 +09:00
Ryo Nakamura
309371ed75 now make install installs libmscp 2023-03-10 21:10:06 +09:00
Ryo Nakamura
1e92ff9e77 fix CMakeLists to build libmscp on ubnutu 22.04 2023-03-10 20:29:46 +09:00
Ryo Nakamura
b3b7299990 merge main into lib 2023-03-10 20:11:44 +09:00
Ryo Nakamura
ca94d77e45 fix typo 2023-03-10 02:09:04 +09:00
Ryo Nakamura
34a0e0c891 add alpine docker to build mscp as a single binary
The build recipe in docker/alpine-3.17.Dockerfile uses conan to
build mscp as a single binary (with statically linked musl).

Now the mscp binary is portable!
2023-03-10 00:37:06 +09:00
Ryo Nakamura
c39ab7ce62 add conanfile.txt to compile mscp as a single binary
conan cmake build with -DBUILD_CONAN=ON and -DBUILD_STATIC=ON in
alpine make mscp as a single binary with statically linked musl.
2023-03-09 23:21:58 +09:00
Ryo Nakamura
e56e1be4f6 Merge branch 'main' of github.com:upa/mscp into main 2023-03-09 22:33:04 +09:00
Ryo Nakamura
c07bdd60e5 fix cmake: remove modification to libssh CMake 2023-03-09 22:32:42 +09:00
Ryo Nakamura
d766b3a99e fix dryrun handling on main.c 2023-03-04 19:01:44 +09:00