mirror of
https://github.com/upa/mscp.git
synced 2026-02-04 03:24:58 +08:00
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.
This commit is contained in:
@@ -155,7 +155,7 @@ int mscp_set_dst_path(struct mscp *m, const char *dst_path);
|
||||
/**
|
||||
* @brief Prepare for file transfer. This function checks all source
|
||||
* files (recursively), resolve paths on the destination side, and
|
||||
* calculate file chunks.
|
||||
* calculate file chunks. This function is non-blocking.
|
||||
*
|
||||
* @param m mscp instance.
|
||||
*
|
||||
@@ -164,6 +164,17 @@ int mscp_set_dst_path(struct mscp *m, const char *dst_path);
|
||||
*/
|
||||
int mscp_prepare(struct mscp *m);
|
||||
|
||||
/**
|
||||
* @brief Join prepare thread invoked by mscp_prepare(). mscp_join()
|
||||
* involves this, so that mscp_prepare_join() should be called when
|
||||
* mscp_prepare() is called by mscp_start() is not.
|
||||
*
|
||||
* @param m mscp instance.
|
||||
* @return 0 on success, < 0 if an error occured.
|
||||
* mscp_get_error() can be used to retrieve error message.
|
||||
*/
|
||||
int mscp_prepare_join(struct mscp *m);
|
||||
|
||||
/**
|
||||
* @brief Start to copy files. mscp_start() returns immediately. You
|
||||
* can get statistics via mscp_get_stats() or messages via pipe set by
|
||||
|
||||
Reference in New Issue
Block a user