From 70c808c30e8adfdd5f652d5afda244b466317a76 Mon Sep 17 00:00:00 2001 From: sisong Date: Wed, 13 Sep 2023 15:19:50 +0800 Subject: [PATCH 1/4] update readme & libs; --- HDiffPatch | 2 +- README.md | 4 ++-- README_cn.md | 4 ++-- builds/vc/libHttps.vcxproj | 16 ++++++++-------- zlib | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/HDiffPatch b/HDiffPatch index ae58359..6b3453c 160000 --- a/HDiffPatch +++ b/HDiffPatch @@ -1 +1 @@ -Subproject commit ae583590fd62734209c37c0810f0e1944f722281 +Subproject commit 6b3453ca00bc4b25c084fcfceb8ec9efe45f0a31 diff --git a/README.md b/README.md index da312f4..86ab2aa 100644 --- a/README.md +++ b/README.md @@ -221,8 +221,8 @@ client sync diff&patch by `hsync_demo {old} {newi} {newz} {out_new}` (all files |:----|----:|----:|----:|----:|----:|----:| |zsync|52.94%|1M|353.9MB/s|7M|23M|34MB/s| |zsync -z|20.67%|1M|14.8MB/s|12M|37M|28MB/s| -|hsynz|51.05%|5M|2219.3MB/s|5M|19M|191MB/s| -|hsynz|51.05%|18M|4646.8MB/s|12M|27M|331MB/s| +|hsynz p1|51.05%|5M|2219.3MB/s|5M|19M|191MB/s| +|hsynz p8|51.05%|18M|4646.8MB/s|12M|27M|331MB/s| |hsynz p1 -zlib|20.05%|6M|17.7MB/s|6M|21M|160MB/s| |hsynz p8 -zlib|20.05%|30M|119.5MB/s|13M|29M|246MB/s| |hsynz p1 -gzip|20.12%|6M|17.6MB/s|6M|21M|160MB/s| diff --git a/README_cn.md b/README_cn.md index 00a6918..ad83967 100644 --- a/README_cn.md +++ b/README_cn.md @@ -215,8 +215,8 @@ hsync_make: [options] newDataPath out_hsyni_file [out_hsynz_file] |:----|----:|----:|----:|----:|----:|----:| |zsync|52.94%|1M|353.9MB/s|7M|23M|34MB/s| |zsync -z|20.67%|1M|14.8MB/s|12M|37M|28MB/s| -|hsynz|51.05%|5M|2219.3MB/s|5M|19M|191MB/s| -|hsynz|51.05%|18M|4646.8MB/s|12M|27M|331MB/s| +|hsynz p1|51.05%|5M|2219.3MB/s|5M|19M|191MB/s| +|hsynz p8|51.05%|18M|4646.8MB/s|12M|27M|331MB/s| |hsynz p1 -zlib|20.05%|6M|17.7MB/s|6M|21M|160MB/s| |hsynz p8 -zlib|20.05%|30M|119.5MB/s|13M|29M|246MB/s| |hsynz p1 -gzip|20.12%|6M|17.6MB/s|6M|21M|160MB/s| diff --git a/builds/vc/libHttps.vcxproj b/builds/vc/libHttps.vcxproj index 66d2545..fdc8067 100644 --- a/builds/vc/libHttps.vcxproj +++ b/builds/vc/libHttps.vcxproj @@ -209,56 +209,56 @@ true .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ true .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ true .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ true .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ false .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ false .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ false .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ false .lib - ..\..\minihttp\mbedtls\include;..\..\minihttp\mbedtls\crypto\include;$(IncludePath) + ..\..\minihttp\mbedtls\include;$(IncludePath) $(Configuration)\$(Platform)\ $(Configuration)\$(Platform)\https_obj\ diff --git a/zlib b/zlib index 04f42ce..09155ea 160000 --- a/zlib +++ b/zlib @@ -1 +1 @@ -Subproject commit 04f42ceca40f73e2978b50e93806c2a18c1281fc +Subproject commit 09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851 From bbd7da0aa99ee7273784b4d3a4a63ffb610cefa8 Mon Sep 17 00:00:00 2001 From: sisong Date: Mon, 6 Nov 2023 14:35:09 +0800 Subject: [PATCH 2/4] support long path on Windows OS; update HDiffPatch; --- HDiffPatch | 2 +- builds/vc/hsync_demo.vcxproj | 24 ++++++++++++++++++++++++ builds/vc/hsync_http.vcxproj | 24 ++++++++++++++++++++++++ builds/vc/hsync_make.vcxproj | 24 ++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) diff --git a/HDiffPatch b/HDiffPatch index 6b3453c..ef3bf6a 160000 --- a/HDiffPatch +++ b/HDiffPatch @@ -1 +1 @@ -Subproject commit 6b3453ca00bc4b25c084fcfceb8ec9efe45f0a31 +Subproject commit ef3bf6a60585c8e398c654305e395a36d8aaf92e diff --git a/builds/vc/hsync_demo.vcxproj b/builds/vc/hsync_demo.vcxproj index 101b0b8..5aaac46 100644 --- a/builds/vc/hsync_demo.vcxproj +++ b/builds/vc/hsync_demo.vcxproj @@ -195,6 +195,9 @@ true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -208,6 +211,9 @@ true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -221,6 +227,9 @@ true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -234,6 +243,9 @@ true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -250,6 +262,9 @@ true true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -266,6 +281,9 @@ true true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -280,6 +298,9 @@ false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -294,6 +315,9 @@ false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + diff --git a/builds/vc/hsync_http.vcxproj b/builds/vc/hsync_http.vcxproj index 2f4378f..fc75221 100644 --- a/builds/vc/hsync_http.vcxproj +++ b/builds/vc/hsync_http.vcxproj @@ -176,6 +176,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -189,6 +192,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -207,6 +213,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -225,6 +234,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -238,6 +250,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -251,6 +266,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -269,6 +287,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -287,6 +308,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + diff --git a/builds/vc/hsync_make.vcxproj b/builds/vc/hsync_make.vcxproj index 2176dc2..f5a856d 100644 --- a/builds/vc/hsync_make.vcxproj +++ b/builds/vc/hsync_make.vcxproj @@ -176,6 +176,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -189,6 +192,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -206,6 +212,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -223,6 +232,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -236,6 +248,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -249,6 +264,9 @@ Console true + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -266,6 +284,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + @@ -283,6 +304,9 @@ true false + + ..\..\HDiffPatch\builds\vc\longPathAware.exe.manifest %(AdditionalManifestFiles) + From 12556a50b4efbe46d11e48f2bfbbdaae5ed9cfe4 Mon Sep 17 00:00:00 2001 From: sisong Date: Wed, 8 Nov 2023 16:52:19 +0800 Subject: [PATCH 3/4] when oldPath==null then oldPath=""; & support _IS_NEED_PRINT_LOG (default 1); --- hsync_demo.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/hsync_demo.cpp b/hsync_demo.cpp index 7e62710..4488f5d 100644 --- a/hsync_demo.cpp +++ b/hsync_demo.cpp @@ -52,6 +52,15 @@ #ifndef _IS_SYNC_PATCH_DEMO # define _IS_SYNC_PATCH_DEMO 1 #endif +#ifndef _IS_NEED_PRINT_LOG +# define _IS_NEED_PRINT_LOG 1 +#endif +#if (_IS_NEED_PRINT_LOG) +# define _log_info_utf8 hpatch_printPath_utf8 +#else +# define printf(...) +# define _log_info_utf8(...) do{}while(0) +#endif typedef struct TSyncDownloadPlugin{ //download range of file @@ -594,8 +603,8 @@ int sync_client_cmd_line(int argc, const char * argv[]) { _check3(hpatch_isPathNotExist(hsyni_file),kSyncClient_overwritePathError, "file \"",hsyni_file,"\" already exists, overwrite"); double dtime0=clock_s(); - printf( "download .hsyni: \""); hpatch_printPath_utf8(hsyni_file); - printf("\"\n from URL: \""); hpatch_printPath_utf8(hsyni_file_url); + printf( "download .hsyni: \""); _log_info_utf8(hsyni_file); + printf("\"\n from URL: \""); _log_info_utf8(hsyni_file_url); printf("\"\n"); int result=downloadNewSyncInfoFile(&downloadPlugin,hsyni_file_url,hsyni_file, isUsedDownloadContinue!=0); @@ -709,24 +718,28 @@ bool getFileSize(const char *path_utf8,hpatch_StreamPos_t* out_fileSize){ return out_type==kPathType_file; } -static bool printFileInfo(const char *path_utf8,const char *tag,bool isOutSize=true,hpatch_StreamPos_t* out_fileSize=0){ +static bool printFileInfo(const char *path_utf8,const char *tag,bool isOutSize=true){ +#if (_IS_NEED_PRINT_LOG) hpatch_StreamPos_t fileSize=0; if (!getFileSize(path_utf8,&fileSize)) return false; if (isOutSize) printf("%s: %" PRIu64 " \"",tag,fileSize); else printf("%s: \"",tag); - hpatch_printPath_utf8(path_utf8); printf("\"\n"); - if (out_fileSize) *out_fileSize=fileSize; + _log_info_utf8(path_utf8); printf("\"\n"); +#endif return true; } + +static const char* _kEmptyStr=""; TSyncClient_resultType hsync_patch_2file(const char* outNewFile,const char* oldPath,bool oldIsDir, const std::vector& ignoreOldPathList, const char* hsyni_file,IReadSyncDataListener* syncDataListener, const char* localDiffFile,TSyncDiffType diffType,hpatch_BOOL isUsedDownloadContinue, size_t kMaxOpenFileNumber,int threadNum){ + if (oldPath==0) oldPath=_kEmptyStr; #if (_IS_NEED_DIR_DIFF_PATCH) std::string _oldPath(oldPath); if (oldIsDir) assignDirTag(_oldPath); oldPath=_oldPath.c_str(); #endif @@ -736,7 +749,6 @@ TSyncClient_resultType if (oldIsDir){ _check3(getManifest(oldManifest,oldPath,oldIsDir,ignoreOldPathList), kSyncClient_oldDirOpenError,"open oldPath \"",oldPath,"\""); - _oldPath=oldManifest.rootPath.c_str(); } #endif printFileInfo(hsyni_file, "info .hsyni "); @@ -835,7 +847,7 @@ static const char* TDirSyncPatchListener_getOldPathByIndex(TDirSyncPatchListener if (!hpatch_setIsExecuteFile(executeFileName)){ result=hpatch_FALSE; printf("WARNING: can't set Execute tag to new file \""); - hpatch_printPath_utf8(executeFileName); printf("\"\n"); + _log_info_utf8(executeFileName); printf("\"\n"); } } return result; @@ -858,6 +870,7 @@ TSyncClient_resultType const char* hsyni_file,const TSyncDownloadPlugin* downloadPlugin,const char* hsynz_file_url, const char* localDiffFile,TSyncDiffType diffType,hpatch_BOOL isUsedDownloadContinue, size_t kStepRangeNumber,size_t kMaxOpenFileNumber,int threadNum){ + if (oldPath==0) oldPath=_kEmptyStr; std::string _outNewDir(outNewDir?outNewDir:""); if (outNewDir) { assignDirTag(_outNewDir); outNewDir=outNewDir?_outNewDir.c_str():0; } std::string _oldPath(oldPath); if (oldIsDir) assignDirTag(_oldPath); oldPath=_oldPath.c_str(); @@ -867,7 +880,6 @@ TSyncClient_resultType { _check3(getManifest(oldManifest,oldPath,oldIsDir,ignoreOldPathList), kSyncClient_oldDirOpenError,"open oldPath \"",oldPath,"\""); - _oldPath=oldManifest.rootPath.c_str(); } printFileInfo(hsyni_file, "info .hsyni"); From 626d1fa8ee0c4b4cfcff3c57044cc64ee0edb33d Mon Sep 17 00:00:00 2001 From: sisong Date: Wed, 8 Nov 2023 16:54:52 +0800 Subject: [PATCH 4/4] update version; --- README.md | 2 +- README_cn.md | 2 +- hsync_import_patch.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 86ab2aa..5c13a22 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # [hsynz](https://github.com/sisong/hsynz) -[![release](https://img.shields.io/badge/release-v0.9.4-blue.svg)](https://github.com/sisong/hsynz/releases) +[![release](https://img.shields.io/badge/release-v1.0.0-blue.svg)](https://github.com/sisong/hsynz/releases) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/hsynz/blob/main/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/hsynz/pulls) [![+issue Welcome](https://img.shields.io/github/issues-raw/sisong/hsynz?color=green&label=%2Bissue%20welcome)](https://github.com/sisong/hsynz/issues) diff --git a/README_cn.md b/README_cn.md index ad83967..445a309 100644 --- a/README_cn.md +++ b/README_cn.md @@ -1,5 +1,5 @@ # [hsynz](https://github.com/sisong/hsynz) -[![release](https://img.shields.io/badge/release-v0.9.4-blue.svg)](https://github.com/sisong/hsynz/releases) +[![release](https://img.shields.io/badge/release-v1.0.0-blue.svg)](https://github.com/sisong/hsynz/releases) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/hsynz/blob/main/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/hsynz/pulls) [![+issue Welcome](https://img.shields.io/github/issues-raw/sisong/hsynz?color=green&label=%2Bissue%20welcome)](https://github.com/sisong/hsynz/issues) diff --git a/hsync_import_patch.h b/hsync_import_patch.h index 3d1bca6..14b2538 100644 --- a/hsync_import_patch.h +++ b/hsync_import_patch.h @@ -11,9 +11,9 @@ #ifdef __cplusplus extern "C" { #endif -#define HSYNC_VERSION_MAJOR 0 -#define HSYNC_VERSION_MINOR 9 -#define HSYNC_VERSION_RELEASE 4 +#define HSYNC_VERSION_MAJOR 1 +#define HSYNC_VERSION_MINOR 0 +#define HSYNC_VERSION_RELEASE 0 #define _HSYNC_VERSION HSYNC_VERSION_MAJOR.HSYNC_VERSION_MINOR.HSYNC_VERSION_RELEASE #define _HSYNC_QUOTE(str) #str