Skip to content

Commit

Permalink
Merge pull request #34 from libxengine/develop
Browse files Browse the repository at this point in the history
V3.13.0.1001 Merge
  • Loading branch information
xengine-qyt authored Mar 1, 2024
2 parents 4472db7 + af75ff6 commit 2bb43d2
Show file tree
Hide file tree
Showing 41 changed files with 517 additions and 168 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
XEngine_Storage V3.13.0.1001

增加:st_PermissionFlags增加新的标志位上传限制,现在上传文件也可以进行限制了
增加:boundary文件上传支持
优化:选择模式代码
更新:匹配XENGINE V8.25版本
修改:获取目录大小函数单独出来了
修正:上传覆写标识不起作用的问题
修正:禁用标识在下载的时候没有作用的问题
修正:配置文件字段逻辑型类型问题
删除:put方法支持

added:st_PermissionFlags a new flag use to upload limit. and now upload file size and enable limit supported
added:boundary upload file supported
improved:select mode code
update:match xengine v8.25
modify:Wrapped function to get folder size
fixed:upload rewrite flag is not work
fixed:disable flag does not work in download
fixed:configure field is not boolean
delete:upload put method
======================================================================================
XEngine_Storage V3.12.1.1001

修改:不在插入数据当HTTP的HOOK出错
Expand Down
5 changes: 3 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ best storage service for http,more concise code. On going maintenance
The purpose of development and implementation based on libXEngine is a cross-platform network storage service

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

## install

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

## 安装教程

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

## 视频教程
你也可以观看视频教程来了解我们的代码框架情况:https://www.bilibili.com/video/BV1PF4m177Gt

## 其他问题
你可以参考docment目录下的文档.里面包含了API协议和服务说明.
jsoncpp模块在使用的时候编译运行时库选择必须一致.否则会崩溃.
Expand Down
15 changes: 7 additions & 8 deletions XEngine_APPClient/APPClient_Download/APPClient_Download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <windows.h>
#include <tchar.h>
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi")
#pragma comment(lib,"Ws2_32")
#ifdef _WIN64
Expand All @@ -24,8 +24,8 @@
#include <XEngine_Include/XEngine_ProtocolHdr.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
Expand All @@ -34,8 +34,7 @@ using namespace std;

//需要优先配置XEngine
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
//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
//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
//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

typedef struct
{
Expand Down Expand Up @@ -129,11 +128,11 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCXSTR lpszFile)
bool bComplete = true;
for (unsigned int i = 0; i < pStl_ListFile->size(); i++)
{
NETHELP_FILEINFO st_TaskInfo;
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
XCLIENT_APIFILE st_TaskInfo;
memset(&st_TaskInfo, '\0', sizeof(XCLIENT_APIFILE));

APIClient_File_Query(pSt_P2PFile[i].xhToken, &st_TaskInfo);
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
if (ENUM_XCLIENT_APIHELP_FILE_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
{
bComplete = FALSE;
}
Expand Down
9 changes: 4 additions & 5 deletions XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <tchar.h>
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
#pragma comment(lib,"Ws2_32")
#ifdef _WIN64
#pragma comment(lib,"../../XEngine_Source/x64/Debug/jsoncpp")
Expand All @@ -23,15 +23,14 @@
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
using namespace std;

//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
//需要优先配置XEngine
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
//linux使用下面的命令编译
//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
//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

XCHAR tszBaseBuffer[MAX_PATH];
XCHAR tszHdrBuffer[MAX_PATH];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ int main(int argc, char** argv)
for (; stl_ListIterator != stl_ListUPDate.end(); stl_ListIterator++)
{
XCHAR tszPathFile[1024];
NETHELP_FILEINFO st_TaskInfo;
XCLIENT_APIFILE st_TaskInfo;

memset(tszPathFile, '\0', sizeof(tszPathFile));
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
memset(&st_TaskInfo, '\0', sizeof(XCLIENT_APIFILE));

_xstprintf(tszPathFile, _X("%s%s"), stl_ListIterator->tszModulePath, stl_ListIterator->tszModuleName);
_xtremove(tszPathFile);
Expand All @@ -87,7 +87,7 @@ int main(int argc, char** argv)
{
break;
}
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
if (ENUM_XCLIENT_APIHELP_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
{
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <tchar.h>
#pragma comment(lib,"Ws2_32.lib")
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient.lib")
#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib")
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib")
#ifdef _WIN64
#pragma comment(lib,"../../../XEngine_Source/x64/Debug/jsoncpp")
Expand All @@ -24,8 +24,8 @@ using namespace std;
#include <XEngine_Include/XEngine_Types.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma comment(lib,"Ws2_32.lib")
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient.lib")
#pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib")
#ifdef _WIN64
#pragma comment(lib,"../../../XEngine_Source/x64/Debug/jsoncpp")
#else
Expand All @@ -28,8 +28,8 @@ using namespace std;
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>

typedef struct
{
Expand Down Expand Up @@ -75,7 +75,7 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in
XCHAR** ppszListDir;
list<HELPMODULE_FILELIST> stl_ListFile;
//枚举文件
if (!SystemApi_File_EnumFile(lpszPath, &ppszListDir, &nListCount, NULL, NULL, bSubDir, 1))
if (!SystemApi_File_EnumFile(lpszPath, &ppszListDir, &nListCount, bSubDir, 1))
{
return FALSE;
}
Expand Down
10 changes: 5 additions & 5 deletions XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <tchar.h>
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
#pragma comment(lib,"Ws2_32")
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
#ifdef _WIN64
Expand All @@ -24,14 +24,14 @@
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
using namespace std;

//需要优先配置XEngine
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
//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
//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
//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


//上传文件
void File_UPLoad()
Expand Down
20 changes: 20 additions & 0 deletions XEngine_APPClient/download.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download Page</title>
<!-- 可以在这里添加CSS样式或其他头部信息 -->
</head>
<body>
<h1>File Download Example</h1>
<p>Click on the link below to download the file:</p>
<!-- 下载链接 -->
<a href="http://127.0.0.1:5101/storagekey1/1.exe" download="DownloadedFileName.exe">Download Example File</a>
<!--
在 href 属性中填写您要提供下载的文件的正确服务器路径。
download 属性中可以指定下载时保存的文件名。
-->
<!-- 其他内容 -->
</body>
</html>
15 changes: 15 additions & 0 deletions XEngine_APPClient/upload.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple File Upload</title>
</head>
<body>
<h2>Upload your file</h2>
<form action="http://127.0.0.1:5102/api?filename=1.exe&storeagekey=storagekey1"" method="post" enctype="multipart/form-data">
Select file to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload File" name="submit">
</form>
</body>
</html>
Binary file modified XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file modified XEngine_Docment/Docment_zh.docx
Binary file not shown.
1 change: 1 addition & 0 deletions XEngine_Release/XEngine_Config/XEngine_Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"tszCertKey":"./XEngine_Cert/2_www.xyry.org.key"
},
"XVer":[
"3.13.0.1001 Build20240301",
"3.12.1.1001 Build20240104",
"3.12.0.1001 Build20231025",
"3.11.1.1001 Build20230804",
Expand Down
10 changes: 6 additions & 4 deletions XEngine_Release/XEngine_Config/XEngine_LBConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,27 @@
],
"StorageAddr":[
{
"bEnable":1,
"bEnable":false,
"nLevel":1,
"Size":"1024MB",
"XEngine_Key":"storagekey1",
"XEngine_Path":"./XEngine_File",
"PermissionFlags":{
"CreateDir":false,
"Rewrite":false
"Rewrite":false,
"UPLimit": false
}
},
{
"bEnable":1,
"bEnable":true,
"nLevel":1,
"Size":"1024MB",
"XEngine_Key":"storagekey2",
"XEngine_Path":"./XEngine_File2",
"PermissionFlags":{
"CreateDir":false,
"Rewrite":false
"Rewrite":false,
"UPLimit": false
}
}
]
Expand Down
Loading

0 comments on commit 2bb43d2

Please sign in to comment.