Skip to content

Commit 2bb43d2

Browse files
authored
Merge pull request #34 from libxengine/develop
V3.13.0.1001 Merge
2 parents 4472db7 + af75ff6 commit 2bb43d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+517
-168
lines changed

CHANGELOG

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
XEngine_Storage V3.13.0.1001
2+
3+
增加:st_PermissionFlags增加新的标志位上传限制,现在上传文件也可以进行限制了
4+
增加:boundary文件上传支持
5+
优化:选择模式代码
6+
更新:匹配XENGINE V8.25版本
7+
修改:获取目录大小函数单独出来了
8+
修正:上传覆写标识不起作用的问题
9+
修正:禁用标识在下载的时候没有作用的问题
10+
修正:配置文件字段逻辑型类型问题
11+
删除:put方法支持
12+
13+
added:st_PermissionFlags a new flag use to upload limit. and now upload file size and enable limit supported
14+
added:boundary upload file supported
15+
improved:select mode code
16+
update:match xengine v8.25
17+
modify:Wrapped function to get folder size
18+
fixed:upload rewrite flag is not work
19+
fixed:disable flag does not work in download
20+
fixed:configure field is not boolean
21+
delete:upload put method
22+
======================================================================================
123
XEngine_Storage V3.12.1.1001
224

325
修改:不在插入数据当HTTP的HOOK出错

README.en.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ best storage service for http,more concise code. On going maintenance
1515
The purpose of development and implementation based on libXEngine is a cross-platform network storage service
1616

1717
feature list:
18-
1. support file http upload and download(use put and get method)
18+
1. support file http upload and download(use post and get method)
1919
2. support http api notify of event and management api interface
2020
3. support http encrypt and cert data transimission
21-
4. support database(mysql and sqlite) record infomation.
21+
4. support database(mysql) record infomation.
2222
5. support load banace
2323
6. supprot http auth
2424
7. support log and config
@@ -32,6 +32,7 @@ feature list:
3232
15. support full speed and limit speed
3333
16. permission control
3434
17. upload file rewrite
35+
18. support convert record(Active download)
3536

3637
## install
3738

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ c c++ file storage service
1414
## 软件特性
1515
基于libXEngine开发并实现的一套简洁高性能跨平台网络存储服务
1616
软件特性:
17-
1. 支持HTTP协议上传和下载(采用PUT和GET)
17+
1. 支持HTTP协议上传和下载(采用POST和GET)
1818
2. 支持HTTP API接口事件通知与管理
1919
3. 支持HTTP加密与证书
20-
4. 采用数据库(MYSQL和SQLITE)记录信息
20+
4. 采用数据库(MYSQL)记录信息
2121
5. 支持分布式
2222
6. 支持HTTP验证
2323
7. 支持详尽的日志和配置信息
@@ -31,6 +31,7 @@ c c++ file storage service
3131
15. 支持全速模式和限速模式
3232
16. 权限控制
3333
17. 上传文件覆写
34+
18. 支持转录(主动下载)
3435

3536
## 安装教程
3637

@@ -104,6 +105,9 @@ P2P广域网文件查找与下载支持
104105
如果是升级安装,下载新版本后修改配置文件就可以直接运行了
105106
如果使用了数据库,需要打开数据库匹配字段和表是否一致
106107

108+
## 视频教程
109+
你也可以观看视频教程来了解我们的代码框架情况:https://www.bilibili.com/video/BV1PF4m177Gt
110+
107111
## 其他问题
108112
你可以参考docment目录下的文档.里面包含了API协议和服务说明.
109113
jsoncpp模块在使用的时候编译运行时库选择必须一致.否则会崩溃.

XEngine_APPClient/APPClient_Download/APPClient_Download.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <windows.h>
77
#include <tchar.h>
88
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
9-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
9+
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
1010
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi")
1111
#pragma comment(lib,"Ws2_32")
1212
#ifdef _WIN64
@@ -24,8 +24,8 @@
2424
#include <XEngine_Include/XEngine_ProtocolHdr.h>
2525
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2626
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
27-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
28-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
27+
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
28+
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
2929
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
3030
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
3131
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
@@ -34,8 +34,7 @@ using namespace std;
3434

3535
//需要优先配置XEngine
3636
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
37-
//linux::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L /usr/local/lib/XEngine_Release/XEngine_SystemSdk -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -lXEngine_SystemApi -ljsoncpp
38-
//macos::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -lXEngine_SystemApi -ljsoncpp
37+
//linux macos::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXClient_APIHelp -lXEngine_SystemApi -ljsoncpp
3938

4039
typedef struct
4140
{
@@ -129,11 +128,11 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCXSTR lpszFile)
129128
bool bComplete = true;
130129
for (unsigned int i = 0; i < pStl_ListFile->size(); i++)
131130
{
132-
NETHELP_FILEINFO st_TaskInfo;
133-
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
131+
XCLIENT_APIFILE st_TaskInfo;
132+
memset(&st_TaskInfo, '\0', sizeof(XCLIENT_APIFILE));
134133

135134
APIClient_File_Query(pSt_P2PFile[i].xhToken, &st_TaskInfo);
136-
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
135+
if (ENUM_XCLIENT_APIHELP_FILE_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
137136
{
138137
bComplete = FALSE;
139138
}

XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
55
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
6-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
6+
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
77
#pragma comment(lib,"Ws2_32")
88
#ifdef _WIN64
99
#pragma comment(lib,"../../XEngine_Source/x64/Debug/jsoncpp")
@@ -23,15 +23,14 @@
2323
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
2424
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
2525
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
26-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
27-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
26+
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
27+
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
2828
using namespace std;
2929

30-
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
3130
//需要优先配置XEngine
3231
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
3332
//linux使用下面的命令编译
34-
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp
33+
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXClient_APIHelp -ljsoncpp
3534

3635
XCHAR tszBaseBuffer[MAX_PATH];
3736
XCHAR tszHdrBuffer[MAX_PATH];

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ int main(int argc, char** argv)
7272
for (; stl_ListIterator != stl_ListUPDate.end(); stl_ListIterator++)
7373
{
7474
XCHAR tszPathFile[1024];
75-
NETHELP_FILEINFO st_TaskInfo;
75+
XCLIENT_APIFILE st_TaskInfo;
7676

7777
memset(tszPathFile, '\0', sizeof(tszPathFile));
78-
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
78+
memset(&st_TaskInfo, '\0', sizeof(XCLIENT_APIFILE));
7979

8080
_xstprintf(tszPathFile, _X("%s%s"), stl_ListIterator->tszModulePath, stl_ListIterator->tszModuleName);
8181
_xtremove(tszPathFile);
@@ -87,7 +87,7 @@ int main(int argc, char** argv)
8787
{
8888
break;
8989
}
90-
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
90+
if (ENUM_XCLIENT_APIHELP_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
9191
{
9292
break;
9393
}

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPHdr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"Ws2_32.lib")
55
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
6-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient.lib")
6+
#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib")
77
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib")
88
#ifdef _WIN64
99
#pragma comment(lib,"../../../XEngine_Source/x64/Debug/jsoncpp")
@@ -24,8 +24,8 @@ using namespace std;
2424
#include <XEngine_Include/XEngine_Types.h>
2525
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2626
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
27-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
28-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
27+
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
28+
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
2929
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
3030
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
3131
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>

XEngine_APPClient/APPClient_UPDate/APPClient_UPMaker/APPClient_UPMaker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma comment(lib,"Ws2_32.lib")
66
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
77
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib")
8-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient.lib")
8+
#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib")
99
#ifdef _WIN64
1010
#pragma comment(lib,"../../../XEngine_Source/x64/Debug/jsoncpp")
1111
#else
@@ -28,8 +28,8 @@ using namespace std;
2828
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
2929
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
3030
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
31-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
32-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
31+
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
32+
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
3333

3434
typedef struct
3535
{
@@ -75,7 +75,7 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in
7575
XCHAR** ppszListDir;
7676
list<HELPMODULE_FILELIST> stl_ListFile;
7777
//枚举文件
78-
if (!SystemApi_File_EnumFile(lpszPath, &ppszListDir, &nListCount, NULL, NULL, bSubDir, 1))
78+
if (!SystemApi_File_EnumFile(lpszPath, &ppszListDir, &nListCount, bSubDir, 1))
7979
{
8080
return FALSE;
8181
}

XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
55
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
6-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
6+
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
77
#pragma comment(lib,"Ws2_32")
88
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
99
#ifdef _WIN64
@@ -24,14 +24,14 @@
2424
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
2525
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
2626
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
27-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
28-
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
27+
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
28+
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
2929
using namespace std;
3030

3131
//需要优先配置XEngine
3232
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
33-
//linux::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIClient -ljsoncpp
34-
//macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIClient -ljsoncpp
33+
//linux macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lXEngine_OPenSsl -lXClient_APIHelp -ljsoncpp
34+
3535

3636
//上传文件
3737
void File_UPLoad()

XEngine_APPClient/download.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Download Page</title>
7+
<!-- 可以在这里添加CSS样式或其他头部信息 -->
8+
</head>
9+
<body>
10+
<h1>File Download Example</h1>
11+
<p>Click on the link below to download the file:</p>
12+
<!-- 下载链接 -->
13+
<a href="http://127.0.0.1:5101/storagekey1/1.exe" download="DownloadedFileName.exe">Download Example File</a>
14+
<!--
15+
在 href 属性中填写您要提供下载的文件的正确服务器路径。
16+
download 属性中可以指定下载时保存的文件名。
17+
-->
18+
<!-- 其他内容 -->
19+
</body>
20+
</html>

XEngine_APPClient/upload.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Simple File Upload</title>
6+
</head>
7+
<body>
8+
<h2>Upload your file</h2>
9+
<form action="http://127.0.0.1:5102/api?filename=1.exe&storeagekey=storagekey1"" method="post" enctype="multipart/form-data">
10+
Select file to upload:
11+
<input type="file" name="fileToUpload" id="fileToUpload">
12+
<input type="submit" value="Upload File" name="submit">
13+
</form>
14+
</body>
15+
</html>

XEngine_Docment/Docment_en.docx

244 Bytes
Binary file not shown.

XEngine_Docment/Docment_zh.docx

228 Bytes
Binary file not shown.

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"tszCertKey":"./XEngine_Cert/2_www.xyry.org.key"
7373
},
7474
"XVer":[
75+
"3.13.0.1001 Build20240301",
7576
"3.12.1.1001 Build20240104",
7677
"3.12.0.1001 Build20231025",
7778
"3.11.1.1001 Build20230804",

XEngine_Release/XEngine_Config/XEngine_LBConfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,27 @@
1818
],
1919
"StorageAddr":[
2020
{
21-
"bEnable":1,
21+
"bEnable":false,
2222
"nLevel":1,
2323
"Size":"1024MB",
2424
"XEngine_Key":"storagekey1",
2525
"XEngine_Path":"./XEngine_File",
2626
"PermissionFlags":{
2727
"CreateDir":false,
28-
"Rewrite":false
28+
"Rewrite":false,
29+
"UPLimit": false
2930
}
3031
},
3132
{
32-
"bEnable":1,
33+
"bEnable":true,
3334
"nLevel":1,
3435
"Size":"1024MB",
3536
"XEngine_Key":"storagekey2",
3637
"XEngine_Path":"./XEngine_File2",
3738
"PermissionFlags":{
3839
"CreateDir":false,
39-
"Rewrite":false
40+
"Rewrite":false,
41+
"UPLimit": false
4042
}
4143
}
4244
]

0 commit comments

Comments
 (0)