Skip to content

Commit 6689aca

Browse files
authored
Merge pull request #15 from libxengine/develop
V3.1 Merge
2 parents c4df1a8 + ef2316b commit 6689aca

30 files changed

+361
-468
lines changed

README.en.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The purpose of development and implementation based on libXEngine is a cross-pla
1616
feature list:
1717
1. support file http upload and download(use put and get method)
1818
2. support http api notify of event and management api interface
19-
3. support http encrypt and cert data transimission(planning)
19+
3. support http encrypt and cert data transimission
2020
4. support database(mysql and sqlite) record infomation.
2121
5. support load banace
2222
6. supprot http auth
@@ -27,15 +27,14 @@ feature list:
2727
11. bt(planning)
2828
12. data distributed
2929
13. support second pass and Resumable
30-
14. support nginx upload module proxy_pass
31-
15. support upload and download Redirect
32-
16. support full speed and limit speed
30+
14. support upload and download Redirect
31+
15. support full speed and limit speed
3332

3433
## install
3534

3635
#### Requirements
3736
support system above windows 7sp1 and linux(ubuntu20.04,centos8)
38-
XEngine need V7.18 or above
37+
XEngine need V7.24 or above
3938
vcpkg need 2021.05.11 or above
4039

4140
#### Windows

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ c c++ file storage service
1515
软件特性:
1616
1. 支持HTTP协议上传和下载(采用PUT和GET)
1717
2. 支持HTTP API接口事件通知与管理
18-
3. 支持HTTP加密与证书(规划中)
18+
3. 支持HTTP加密与证书
1919
4. 采用数据库(MYSQL和SQLITE)记录信息
2020
5. 支持分布式
2121
6. 支持HTTP验证
@@ -26,15 +26,14 @@ c c++ file storage service
2626
11. BT(规划中)
2727
12. 数据分发
2828
13. 支持秒传和断点续传
29-
14. 支持NGINX UPLOAD MODULE上传代理
30-
15. 支持上传和下载重定向
31-
16. 支持全速模式和限速模式
29+
14. 支持上传和下载重定向
30+
15. 支持全速模式和限速模式
3231

3332
## 安装教程
3433

3534
#### 版本需求
3635
支持WINDOWS 7SP1和LINUX(UBUNT20.04,CENTOS8)以上系统
37-
XEngine版本需要V7.18或者以上版本
36+
XEngine版本需要V7.24或者以上版本
3837
vcpkg 需要2021.05.11以上版本
3938

4039
#### Windows

XEngine_Docment/Docment_en.docx

735 Bytes
Binary file not shown.

XEngine_Docment/Docment_zh.docx

674 Bytes
Binary file not shown.

XEngine_Release/XEngine_Cert/.gitignore

Whitespace-only changes.
Lines changed: 84 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,94 @@
11
{
2-
"tszIPAddr": "192.168.1.9",
3-
"bDeamon": 0,
4-
"nCenterPort": 5100,
5-
"nStorageDLPort": 5101,
6-
"nStorageUPPort": 5102,
7-
"nP2XPPort": 5103,
8-
"XMax": {
9-
"MaxClient": 10000,
10-
"MaxQueue": 10000,
11-
"IOThread": 2,
12-
"CenterThread": 2,
13-
"nStorageUPThread": 2,
14-
"nStorageDLThread": 2,
15-
"nP2XPThread": 2
2+
"tszIPAddr":"192.168.1.9",
3+
"bDeamon":0,
4+
"nCenterPort":5100,
5+
"nStorageDLPort":5101,
6+
"nStorageUPPort":5102,
7+
"nP2XPPort":5103,
8+
"XMax":{
9+
"MaxClient":10000,
10+
"MaxQueue":10000,
11+
"IOThread":2,
12+
"CenterThread":2,
13+
"nStorageUPThread":2,
14+
"nStorageDLThread":2,
15+
"nP2XPThread":2
1616
},
17-
"XTime": {
18-
"bHBTime": 0,
19-
"nDBMonth": 3,
20-
"nTimeCheck": 3,
21-
"nCenterTimeOut": 5,
22-
"nStorageTimeOut": 5,
23-
"nP2XPTimeOut": 5
17+
"XTime":{
18+
"bHBTime":0,
19+
"nDBMonth":3,
20+
"nTimeCheck":3,
21+
"nCenterTimeOut":5,
22+
"nStorageTimeOut":5,
23+
"nP2XPTimeOut":5
2424
},
25-
"XLog": {
26-
"MaxSize": 1024000,
27-
"MaxCount": 10,
28-
"LogLeave": 32
25+
"XLog":{
26+
"MaxSize":1024000,
27+
"MaxCount":10,
28+
"LogLeave":32
2929
},
30-
"XSql": {
31-
"SQLType": 0,
32-
"SQLFile": "./XEngine_SQL/SQLFile.db",
33-
"SQLAddr": "192.168.1.9",
34-
"SQLPort": 3306,
35-
"SQLUser": "root",
36-
"SQLPass": "123123Ruiyue"
30+
"XSql":{
31+
"SQLType":0,
32+
"SQLFile":"./XEngine_SQL/SQLFile.db",
33+
"SQLAddr":"127.0.0.1",
34+
"SQLPort":3306,
35+
"SQLUser":"ruiyue",
36+
"SQLPass":"123123Ruiyue"
3737
},
38-
"XStorage": {
39-
"bResumable": 1,
40-
"nHashMode": 2,
41-
"bRename": 0,
42-
"tszFileDir": "/home/ubuntu/桌面/XEngine_Storage/XEngine_Source/Debug/XEngine_File"
38+
"XStorage":{
39+
"bResumable":1,
40+
"nHashMode":2,
41+
"tszFileDir":"/home/ubuntu/桌面/XEngine_Storage/XEngine_Source/Debug/XEngine_File"
4342
},
44-
"XProxy": {
45-
"XProxyAuth": {
46-
"bAuth": 0,
47-
"tszUserList": "./XEngine_Config/UserList.txt",
48-
"tszAuthProxy": ""
49-
},
50-
"XProxyPass": {
51-
"bUPGet": 0,
52-
"bDLGet": 0,
53-
"tszUPPass": "http://192.168.1.7:5200/Api/Pass/UPFile",
54-
"tszDLPass": "http://192.168.1.7:5200/Api/Pass/UPFile"
55-
}
43+
"XProxy":{
44+
"XProxyAuth":{
45+
"bAuth":0,
46+
"tszUserList":"./XEngine_Config/UserList.txt",
47+
"tszAuthProxy":""
48+
},
49+
"XProxyPass":{
50+
"bUPGet":0,
51+
"bDLGet":0,
52+
"tszUPPass":"http://192.168.1.7:5200/Api/Pass/UPFile",
53+
"tszDLPass":"http://192.168.1.7:5200/Api/Pass/UPFile"
54+
}
5655
},
57-
"XLimit": {
58-
"nDLTry": 10,
59-
"nMaxUPLoad": 4096000,
60-
"nMaxDNLoad": 4096000
56+
"XLimit":{
57+
"nDLTry":10,
58+
"nMaxUPLoad":4096000,
59+
"nMaxDNLoad":4096000
6160
},
62-
"XP2xp": {
63-
"nMode": 2,
64-
"nTime": 2,
65-
"nSDPort": 15000,
66-
"nRVPort": 15001,
67-
"tszQQWryFile": "./XEngine_SQL/qqwry.dat"
61+
"XP2xp":{
62+
"nMode":2,
63+
"nTime":2,
64+
"nSDPort":15000,
65+
"nRVPort":15001,
66+
"tszQQWryFile":"./XEngine_SQL/qqwry.dat"
6867
},
69-
"XVer": {
70-
"StorageVersion": [
71-
"3.0.0.1001 Build20211029",
72-
"2.5.0.1001 Build20210930",
73-
"2.4.0.1001 Build20210918",
74-
"2.3.0.1001 Build20210903",
75-
"2.2.0.1001 Build20210820",
76-
"2.1.0.1001 Build20210805",
77-
"2.0.0.1001 Build20210723",
78-
"1.5.0.1001 Build20210716",
79-
"1.4.0.1001 Build20210702",
80-
"1.3.0.1001 Build20210625",
81-
"1.2.0.1001 Build20210618",
82-
"1.1.0.1001 Build20210611",
83-
"1.0.0.1001 Build20210501"
84-
]
68+
"XCert":{
69+
"bDLEnable":0,
70+
"bUPEnable":0,
71+
"bCHEnable":0,
72+
"nSslType":0,
73+
"tszCertChain":"./XEngine_Cert/1_www.xyry.org_bundle.crt",
74+
"tszCertKey":"./XEngine_Cert/2_www.xyry.org.key"
75+
},
76+
"XVer":{
77+
"StorageVersion":[
78+
"3.1.0.1001 Build20211110",
79+
"3.0.0.1001 Build20211029",
80+
"2.5.0.1001 Build20210930",
81+
"2.4.0.1001 Build20210918",
82+
"2.3.0.1001 Build20210903",
83+
"2.2.0.1001 Build20210820",
84+
"2.1.0.1001 Build20210805",
85+
"2.0.0.1001 Build20210723",
86+
"1.5.0.1001 Build20210716",
87+
"1.4.0.1001 Build20210702",
88+
"1.3.0.1001 Build20210625",
89+
"1.2.0.1001 Build20210618",
90+
"1.1.0.1001 Build20210611",
91+
"1.0.0.1001 Build20210501"
92+
]
8593
}
86-
}
94+
}

XEngine_Source/StorageModule_Config/Config_Define.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ typedef struct tag_XEngine_ServerConfig
6363
}st_XSql;
6464
struct
6565
{
66-
BOOL bRename;
6766
BOOL bResumable;
6867
int nHashMode;
6968
TCHAR tszFileDir[MAX_PATH];
@@ -98,6 +97,15 @@ typedef struct tag_XEngine_ServerConfig
9897
int nRVPort;
9998
TCHAR tszQQWryFile[MAX_PATH];
10099
}st_P2xp;
100+
struct
101+
{
102+
TCHAR tszCertChain[MAX_PATH];
103+
TCHAR tszCertKey[MAX_PATH];
104+
int nSslType;
105+
BOOL bDLEnable;
106+
BOOL bUPEnable;
107+
BOOL bCHEnable;
108+
}st_XCert;
101109
struct
102110
{
103111
list<string> *pStl_ListStorage;

XEngine_Source/StorageModule_Config/Config_Error.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_XVER 0x0020008
2424
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_XPROXY 0x0020009
2525
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_P2XP 0x002000A
26+
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_CERT 0x002000B
2627

2728
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBCONFIG 0x0020010
2829
#define ERROR_XENGINE_BLOGIC_CONFIG_JSON_LAODBALANCE 0x0020011

XEngine_Source/StorageModule_Config/Config_Json/Config_Json.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
125125
_tcscpy(pSt_ServerConfig->st_XSql.tszSQLPass, st_JsonXSql["SQLPass"].asCString());
126126
_tcscpy(pSt_ServerConfig->st_XSql.tszSQLFile, st_JsonXSql["SQLFile"].asCString());
127127

128-
if (st_JsonRoot["XStorage"].empty() || (4 != st_JsonRoot["XStorage"].size()))
128+
if (st_JsonRoot["XStorage"].empty() || (3 != st_JsonRoot["XStorage"].size()))
129129
{
130130
Config_IsErrorOccur = TRUE;
131131
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_XSTORAGE;
@@ -134,7 +134,6 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
134134
Json::Value st_JsonXStorage = st_JsonRoot["XStorage"];
135135
pSt_ServerConfig->st_XStorage.nHashMode = st_JsonXStorage["nHashMode"].asInt();
136136
pSt_ServerConfig->st_XStorage.bResumable = st_JsonXStorage["bResumable"].asInt();
137-
pSt_ServerConfig->st_XStorage.bRename = st_JsonXStorage["bRename"].asInt();
138137
_tcscpy(pSt_ServerConfig->st_XStorage.tszFileDir, st_JsonXStorage["tszFileDir"].asCString());
139138

140139
if (st_JsonRoot["XProxy"].empty() || (2 != st_JsonRoot["XProxy"].size()))
@@ -180,6 +179,26 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
180179
pSt_ServerConfig->st_P2xp.nSDPort = st_JsonP2xp["nSDPort"].asInt();
181180
_tcscpy(pSt_ServerConfig->st_P2xp.tszQQWryFile, st_JsonP2xp["tszQQWryFile"].asCString());
182181

182+
if (st_JsonRoot["XCert"].empty() || (6 != st_JsonRoot["XCert"].size()))
183+
{
184+
Config_IsErrorOccur = TRUE;
185+
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_CERT;
186+
return FALSE;
187+
}
188+
Json::Value st_JsonCert = st_JsonRoot["XCert"];
189+
pSt_ServerConfig->st_XCert.bDLEnable = st_JsonCert["bDLEnable"].asInt();
190+
pSt_ServerConfig->st_XCert.bUPEnable = st_JsonCert["bUPEnable"].asInt();
191+
pSt_ServerConfig->st_XCert.bCHEnable = st_JsonCert["bCHEnable"].asInt();
192+
pSt_ServerConfig->st_XCert.nSslType = st_JsonCert["nSslType"].asInt();
193+
if (!st_JsonP2xp["tszCertChain"].isNull())
194+
{
195+
_tcscpy(pSt_ServerConfig->st_XCert.tszCertChain, st_JsonP2xp["tszCertChain"].asCString());
196+
}
197+
if (!st_JsonP2xp["tszCertKey"].isNull())
198+
{
199+
_tcscpy(pSt_ServerConfig->st_XCert.tszCertKey, st_JsonP2xp["tszCertKey"].asCString());
200+
}
201+
183202
if (st_JsonRoot["XVer"].empty() || (1 != st_JsonRoot["XVer"].size()))
184203
{
185204
Config_IsErrorOccur = TRUE;

0 commit comments

Comments
 (0)