Skip to content

Commit ff6ed1d

Browse files
authored
Merge pull request #24 from libxengine/develop
V3.8.0.1001 Merge
2 parents b7e1732 + 1ef0ec1 commit ff6ed1d

File tree

34 files changed

+433
-782
lines changed

34 files changed

+433
-782
lines changed

CHANGELOG

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
XEngine_Storage V3.8.0.1001
2+
3+
更新:匹配了xengine v7.38
4+
修改:支持macos系统了
5+
修改:不在使用BaseLib_OperatorString_GetLastString函数
6+
修改:现在不在对本地文件进行处理了
7+
修改:未完成的上传也返回信息了
8+
修改:上传只支持指定bucket了
9+
修正:linux构建错误
10+
修正:配置错误
11+
修正:心跳和网络句柄打印错误
12+
修正:枚举文件路径参数不正确
13+
修正:程序退出某些时候崩溃的问题
14+
修正:上传返回的json长度字段不正确的问题
15+
优化:版本列表配置
16+
删除:客户端数据库相关代码
17+
删除:无用代码
18+
19+
update:match xengine v7.38
20+
modify:support macos now
21+
modify:does not use BaseLib_OperatorString_GetLastString fuinction
22+
modify:Do not judge the existence of files for this machine
23+
modify:Incomplete uploads also return information
24+
modify:upload supports specifying bucket
25+
fixed:linux build
26+
fixed:configure error
27+
fixed:heartbeat and tcpcore handle print error
28+
fixed:Incorrect path parameter for enumeration file
29+
fixed:The problem is crashed when exiting the program at sometime
30+
fixed:the len field of the upload result json is incorrect
31+
improved:version list configure
32+
delete:client database related code
33+
delete:unused code
34+
======================================================================================
135
XEngine_Storage V3.7.0.1001
236

337
优化:关闭广播

README.en.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,28 @@ feature list:
3333

3434
## install
3535

36-
#### Requirements
37-
support system above windows 7sp1 and linux(ubuntu20.04,centos8)
38-
XEngine need V7.24 or above
36+
#### XEngine Evn
37+
you must install XEngine,need V7.38 or above,install XEngine can be refer to xengine Readme docment
38+
GITEE:https://gitee.com/xyry/libxengine
39+
GITHUB:https://github.com/libxengine/xengine
3940

40-
#### Windows
41-
use vs open and complie
42-
You need to configure the environment in the following way, otherwise you may need to set the library directory in the project yourself
41+
##### fast to deployment
42+
git clone https://gitee.com/xyry/libxengine.git or git clone https://github.com/libxengine/xengine.git
43+
window Exection XEngine_WINEnv.bat
44+
Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
45+
Macos Exection:./XEngine_LINEnv.sh -i 3
4346

44-
##### XEngine
45-
download xengine through git.read xengine project readme file to configure your env
47+
#### Windows
48+
use vs open and compile,suport windows 7sp1 and above
49+
Just Run it,use XEngine_AuthorizeApp
4650

4751
#### Linux
48-
Linux use Makefile to complie
49-
supproted ubuntu x64 or centos x64
52+
use makefile compile,UBUNTU20.04 x64 or CENTOS8 x64
53+
Run it on the terminal
54+
55+
#### Macos
56+
use makefile compile,mac 12 and above
57+
Run it on the terminal
5058

5159
##### complie
5260
execute command in XEngine_Source path
@@ -84,10 +92,11 @@ P2P WAN file search and download support
8492

8593
## other problems
8694
You can refer to the document under the docment directory. It contains API protocol and service description.
95+
When the jsoncpp module is used, the compilation runtime library selection must be consistent
8796

8897
## Test Service
8998
Address:app.xyry.org or 159.75.200.173
90-
Port:HTTP Center Port 5100,Download 5101,UPLoad 5102,P2P 5103
99+
Port:HTTP Center Port 5100,Download 5101,UPLoad 5102
91100

92101
## Participate in contribution
93102

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,28 @@ c c++ file storage service
3232

3333
## 安装教程
3434

35-
#### 版本需求
36-
支持WINDOWS 7SP1和LINUX(UBUNT20.04,CENTOS8)以上系统
37-
XEngine版本需要V7.24或者以上版本
35+
#### XEngine环境
36+
必须安装XEngine,版本需要V7.38或者以上版本,安装XEngine可以参考其Readme文档
37+
GITEE:https://gitee.com/xyry/libxengine
38+
GITHUB:https://github.com/libxengine/xengine
3839

39-
#### Windows
40-
使用VS打开并且编译
41-
你需要按照下面的方式配置环境,不然你可能需要自己在项目中设置库目录
40+
###### 快速部署
41+
git clone https://gitee.com/xyry/libxengine.git 或者 git clone https://github.com/libxengine/xengine.git
42+
window执行XEngine_WINEnv.bat 脚本.
43+
Linux执行:sudo ./XEngine_LINEnv.sh -i 3
44+
macos执行:./XEngine_LINEnv.sh -i 3
4245

43-
##### XEngine环境
44-
XEngine通过GIT下载,参考XEngine项目的readme配置环境
46+
#### Windows
47+
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
48+
直接运行即可,使用XEngine_AuthorizeApp
4549

4650
#### Linux
47-
Linux使用Makefile编译
48-
UBUNTU20.04 x64或者CENTOS8 x64均可
51+
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
52+
在控制台运行
53+
54+
#### Macos
55+
使用makefile编译,控制台运行,需要mac 12以及以上版本
56+
在控制台运行
4957

5058
##### 编译命令
5159
在XEngine_Source目录下执行命令
@@ -81,15 +89,18 @@ P2P分布式下载与其他下载工具的超线程下载一样,原理是使用H
8189

8290
## 当前任务
8391
管理接口调试
92+
本地网络接口删除
93+
客户端连接数限制
8494
P2P广域网文件查找与下载支持
8595
分布式数据库存储
8696

8797
## 其他问题
88-
你可以参考docment目录下的文档.里面包含了API协议和服务说明.
98+
你可以参考docment目录下的文档.里面包含了API协议和服务说明.
99+
jsoncpp模块在使用的时候编译运行时库选择必须一致.否则会崩溃.
89100

90101
## 测试服务器
91102
地址:app.xyry.org 或者 159.75.200.173
92-
端口:HTTP业务端口 5100,下载 5101,上传 5102,P2P 5103
103+
端口:HTTP业务端口 5100,下载 5101,上传 5102
93104

94105
## 参与贡献
95106

XEngine_APPClient/APPClient_Download/APPClient_Download.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ using namespace std;
3333

3434
//需要优先配置XEngine
3535
//WINDOWS使用VS2022 x86 debug 编译
36-
//linux使用下面的命令编译
37-
//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_DownLoad -L /usr/local/lib/XEngine_Release/XEngine_SystemSdk -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIHelp -lXEngine_Download -lXEngine_SystemApi -ljsoncpp
36+
//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_DownLoad -L /usr/local/lib/XEngine_Release/XEngine_SystemSdk -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIHelp -lXEngine_Download -lXEngine_SystemApi -ljsoncpp
37+
//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_APIHelp -lXEngine_Download -lXEngine_SystemApi -ljsoncpp
3838

3939
typedef struct
4040
{

XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
66
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
77
#pragma comment(lib,"Ws2_32")
8+
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
89
#else
910
#endif
1011
#include <stdio.h>
1112
#include <string.h>
1213
#include <time.h>
1314
#include <list>
15+
#include <json/json.h>
1416
#include <XEngine_Include/XEngine_CommHdr.h>
1517
#include <XEngine_Include/XEngine_Types.h>
1618
#include <XEngine_Include/XEngine_ProtocolHdr.h>
@@ -24,8 +26,8 @@ using namespace std;
2426

2527
//需要优先配置XEngine
2628
//WINDOWS使用VS2022 x86 debug 编译
27-
//linux使用下面的命令编译
28-
//g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Core -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -lXEngine_BaseLib -lXEngine_OPenSsl -lNetHelp_APIHelp
29+
//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_APIHelp -ljsoncpp
30+
//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_APIHelp -ljsoncpp
2931

3032
//上传文件
3133
void File_UPLoad()
@@ -36,11 +38,13 @@ void File_UPLoad()
3638
TCHAR* ptszMsgBuffer = NULL;
3739
TCHAR tszBaseBuffer[128];
3840
TCHAR tszHdrBuffer[MAX_PATH];
41+
TCHAR tszKeyBuffer[MAX_PATH];
3942
LPCTSTR lpszMsgBuffer = _T("01234");
4043
LPCTSTR lpszMsgBuffer2 = _T("56789");
4144

4245
memset(tszBaseBuffer, '\0', sizeof(tszBaseBuffer));
4346
memset(tszHdrBuffer, '\0', MAX_PATH);
47+
memset(tszKeyBuffer, '\0', MAX_PATH);
4448
OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer);
4549

4650
_stprintf(tszHdrBuffer, _T("Range: bytes=0-5/10\r\nAuthorization: %s\r\n"), tszBaseBuffer);
@@ -49,11 +53,21 @@ void File_UPLoad()
4953
printf("upload failed:%lX\n", APIHelp_GetLastError());
5054
return;
5155
}
56+
JSONCPP_STRING st_JsonError;
57+
Json::Value st_JsonRoot;
58+
Json::CharReaderBuilder st_JsonBuilder;
59+
std::unique_ptr<Json::CharReader> const pSt_JsonReader(st_JsonBuilder.newCharReader());
60+
if (!pSt_JsonReader->parse(ptszMsgBuffer, ptszMsgBuffer + nLen, &st_JsonRoot, &st_JsonError))
61+
{
62+
return;
63+
}
64+
_tcscpy(tszKeyBuffer, st_JsonRoot["lpszBuckKey"].asCString());
65+
5266
printf("upload:%d\n", nCode);
5367
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
54-
68+
//断点续传必须指定storagekey
5569
memset(tszHdrBuffer, '\0', MAX_PATH);
56-
_stprintf(tszHdrBuffer, _T("Range: bytes=5-9/10\r\nAuthorization: %s\r\n"), tszBaseBuffer);
70+
_stprintf(tszHdrBuffer, _T("Range: bytes=5-9/10\r\nAuthorization: %s\r\nStorageKey: %s\r\n"), tszBaseBuffer, tszKeyBuffer);
5771
if (!APIHelp_HttpRequest_Post(lpszUrl, lpszMsgBuffer2, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer))
5872
{
5973
printf("upload failed:%lX\n", APIHelp_GetLastError());

XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<LinkIncremental>true</LinkIncremental>
75-
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<IncludePath>$(XEngine_Include);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
7676
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
7777
</PropertyGroup>
7878
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

XEngine_Docment/Docment_en.docx

-77 Bytes
Binary file not shown.

XEngine_Docment/Docment_zh.docx

104 Bytes
Binary file not shown.
Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
{
2-
"tszIPAddr":"192.168.1.12",
2+
"tszIPAddr":"192.168.1.8",
33
"bDeamon":0,
44
"nCenterPort":5100,
55
"nStorageDLPort":5101,
66
"nStorageUPPort":5102,
7-
"nP2XPPort":5103,
87
"XMax":{
98
"MaxClient":10000,
109
"MaxQueue":10000,
1110
"IOThread":2,
1211
"CenterThread":2,
1312
"nStorageUPThread":2,
14-
"nStorageDLThread":2,
15-
"nP2XPThread":2
13+
"nStorageDLThread":2
1614
},
1715
"XTime":{
1816
"bHBTime":0,
1917
"nDBMonth":3,
2018
"nTimeCheck":3,
2119
"nCenterTimeOut":5,
22-
"nStorageTimeOut":5,
23-
"nP2XPTimeOut":5
20+
"nStorageTimeOut":5
2421
},
2522
"XLog":{
2623
"MaxSize":1024000,
@@ -29,7 +26,6 @@
2926
},
3027
"XSql":{
3128
"SQLEnable":false,
32-
"SQLFile":"./XEngine_SQL/SQLFile.db",
3329
"SQLAddr":"192.168.1.12",
3430
"SQLPort":3306,
3531
"SQLUser":"ruiyue",
@@ -56,13 +52,12 @@
5652
"XLimit":{
5753
"nDLTry":10,
5854
"nMaxUPLoad":4096000,
59-
"nMaxDNLoad":40960000
55+
"nMaxDNLoad":4096000
6056
},
6157
"XP2xp":{
6258
"nTime":2,
6359
"nSDPort":15000,
64-
"nRVPort":15001,
65-
"tszQQWryFile":"./XEngine_SQL/qqwry.dat"
60+
"nRVPort":15001
6661
},
6762
"XCert":{
6863
"bDLEnable":0,
@@ -72,29 +67,29 @@
7267
"tszCertChain":"./XEngine_Cert/1_www.xyry.org_bundle.crt",
7368
"tszCertKey":"./XEngine_Cert/2_www.xyry.org.key"
7469
},
75-
"XVer":{
76-
"StorageVersion":[
77-
"3.6.0.1001 Build20220402",
78-
"3.5.1.1001 Build20220314",
79-
"3.5.0.1001 Build20220228",
80-
"3.4.1.1001 Build20220126",
81-
"3.4.0.1001 Build20220121",
82-
"3.3.0.1001 Build20220106",
83-
"3.2.0.1001 Build20211211",
84-
"3.1.0.1001 Build20211109",
85-
"3.0.0.1001 Build20211029",
86-
"2.5.0.1001 Build20210930",
87-
"2.4.0.1001 Build20210918",
88-
"2.3.0.1001 Build20210903",
89-
"2.2.0.1001 Build20210820",
90-
"2.1.0.1001 Build20210805",
91-
"2.0.0.1001 Build20210723",
92-
"1.5.0.1001 Build20210716",
93-
"1.4.0.1001 Build20210702",
94-
"1.3.0.1001 Build20210625",
95-
"1.2.0.1001 Build20210618",
96-
"1.1.0.1001 Build20210611",
97-
"1.0.0.1001 Build20210501"
98-
]
99-
}
70+
"XVer":[
71+
"3.8.0.1001 Build20220727",
72+
"3.7.0.1001 Build20220624",
73+
"3.6.0.1001 Build20220402",
74+
"3.5.1.1001 Build20220314",
75+
"3.5.0.1001 Build20220228",
76+
"3.4.1.1001 Build20220126",
77+
"3.4.0.1001 Build20220121",
78+
"3.3.0.1001 Build20220106",
79+
"3.2.0.1001 Build20211211",
80+
"3.1.0.1001 Build20211109",
81+
"3.0.0.1001 Build20211029",
82+
"2.5.0.1001 Build20210930",
83+
"2.4.0.1001 Build20210918",
84+
"2.3.0.1001 Build20210903",
85+
"2.2.0.1001 Build20210820",
86+
"2.1.0.1001 Build20210805",
87+
"2.0.0.1001 Build20210723",
88+
"1.5.0.1001 Build20210716",
89+
"1.4.0.1001 Build20210702",
90+
"1.3.0.1001 Build20210625",
91+
"1.2.0.1001 Build20210618",
92+
"1.1.0.1001 Build20210611",
93+
"1.0.0.1001 Build20210501"
94+
]
10095
}

XEngine_Release/XEngine_SQL/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)