Skip to content

Commit a8c73d9

Browse files
authored
Merge pull request #7 from libxengine/develop
V1.5版本代码合并请求
2 parents 1e5c6cd + b2ecf40 commit a8c73d9

File tree

92 files changed

+4846
-329
lines changed

Some content is hidden

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

92 files changed

+4846
-329
lines changed

README.en.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@ The purpose of development and implementation based on libXEngine is a cross-pla
1212
This repository has a development and master branch. If you want to use it, please use the master branch
1313

1414
feature list:
15-
1. support file http upload and download(use put and get method)
16-
2. support http api notify of event and management api interface
17-
3. support http encrypt and cert data transimission(planning)
18-
4. support mysql record infomation.
19-
5. support load banace(planning)
20-
6. supprot http auth
21-
7. support log and config
22-
8. supprot speeds contral
23-
9. supprot task start and end proxy forwarding
24-
10.support p2p,bt and many more(planning)
25-
11.support second pass
26-
12.support nginx upload module proxy_pass
27-
13.support upload and download Redirect
15+
1. support file http upload and download(use put and get method)
16+
2. support http api notify of event and management api interface
17+
3. support http encrypt and cert data transimission(planning)
18+
4. support database(mysql and sqlite) record infomation.
19+
5. support load banace
20+
6. supprot http auth
21+
7. support log and config
22+
8. supprot speeds contral
23+
9. supprot task start and end proxy forwarding
24+
10. support p2p
25+
11. bt(planning)
26+
12. data distributed(planning)
27+
13. support second pass
28+
14. support nginx upload module proxy_pass
29+
15. support upload and download Redirect
2830

2931
## install
3032

@@ -85,7 +87,11 @@ The realization of downloading second transmission is to first query the local f
8587
## directory struct
8688
- XEngine_Docment docment directory
8789
- XEngine_Release install directory
88-
- XEngine_Source code directory
90+
- XEngine_Source code directory
91+
- XEngine_APPClient client code dir
92+
93+
## now task
94+
P2P
8995

9096
## other problems
9197
You can refer to the document under the docment directory. It contains API protocol and service description.

README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ c c++ file storage service
1111
基于libXEngine开发并实现的一套简洁高性能跨平台网络存储服务
1212
本仓库有开发和主分支,如果要使用,请使用master分支下的代码
1313
软件特性:
14-
1. 支持HTTP协议上传和下载(采用PUT和GET)
15-
2. 支持HTTP API接口事件通知与管理
16-
3. 支持HTTP加密与证书(规划中)
17-
4. 采用MYSQL记录信息
18-
5. 支持分布式(规划中)
19-
6. 支持HTTP验证
20-
7. 支持详尽的日志和配置信息
21-
8. 支持传输速率控制
22-
9. 支持任务开始结束代理转发
23-
10.支持P2P,BT,数据分发(规划中)
24-
11.支持秒传
25-
12.支持NGINX UPLOAD MODULE上传代理
26-
13.支持上传和下载重定向
14+
1. 支持HTTP协议上传和下载(采用PUT和GET)
15+
2. 支持HTTP API接口事件通知与管理
16+
3. 支持HTTP加密与证书(规划中)
17+
4. 采用数据库(MYSQL和SQLITE)记录信息
18+
5. 支持分布式
19+
6. 支持HTTP验证
20+
7. 支持详尽的日志和配置信息
21+
8. 支持传输速率控制
22+
9. 支持任务开始结束代理转发
23+
10. 支持P2P
24+
11. BT(规划中)
25+
12. 数据分发(规划中)
26+
13. 支持秒传
27+
14. 支持NGINX UPLOAD MODULE上传代理
28+
15. 支持上传和下载重定向
2729

2830
## 安装教程
2931

@@ -75,16 +77,20 @@ make FLAGS=CleanAll 清理编译
7577
6. 通过curl或postman 等三方工具测试上传下载
7678

7779
## 目录结构
78-
- XEngine_Docment 文档目录结构
79-
- XEngine_Release 安装目录结构
80-
- XEngine_Source 源代目录结构
80+
- XEngine_Docment 文档目录结构
81+
- XEngine_Release 安装目录结构
82+
- XEngine_Source 源代目录结构
83+
- XEngine_APPClient 客户端演示代码
8184

8285

8386
## 秒传实现
8487
秒传的实现不是靠服务器实现的,而是靠客户端实现的.
8588
上传秒传的实现是先通过HASH查询文件是否在服务器,如果存在就不上传直接提示客户端上传成功.
8689
下载秒传的实现是先通过HASH查询本地文件保存路径,如果存在就直接下载完成.
8790

91+
## 当前任务
92+
实现P2P
93+
8894
## 其他问题
8995
你可以参考docment目录下的文档.里面包含了API协议和服务说明.
9096

XEngine_Docment/Docment_en.docx

2.38 KB
Binary file not shown.

XEngine_Docment/Docment_zh.docx

2.26 KB
Binary file not shown.

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,16 @@
2525
"LogLeave": 32
2626
},
2727
"XSql": {
28+
"SQLType": 0,
29+
"SQLFile": "./XEngine_SQL/SQLFile.db",
2830
"SQLAddr": "192.168.1.9",
2931
"SQLPort": 3306,
3032
"SQLUser": "root",
3133
"SQLPass": "123123Ruiyue"
3234
},
3335
"XStorage": {
34-
"nUseMode": 0,
3536
"nHashMode": 2,
3637
"bRename": 0,
37-
"tszHttpAddr": "http://192.168.1.9",
38-
"tszNginAddr": "http://192.168.1.9:5010",
3938
"tszFileDir": "./XEngine_File"
4039
},
4140
"XProxy": {
@@ -45,8 +44,8 @@
4544
"tszAuthProxy": ""
4645
},
4746
"XProxyPass": {
48-
"bUPGet": 1,
49-
"bDLGet": 1,
47+
"bUPGet": 0,
48+
"bDLGet": 0,
5049
"tszUPPass": "http://192.168.1.7:5200/Api/Pass/UPFile",
5150
"tszDLPass": "http://192.168.1.7:5200/Api/Pass/UPFile"
5251
}
@@ -57,11 +56,12 @@
5756
},
5857
"XVer": {
5958
"StorageVersion": [
59+
"1.5.0.1001 Build20210716",
6060
"1.4.0.1001 Build20210702",
6161
"1.3.0.1001 Build20210625",
6262
"1.2.0.1001 Build20210618",
6363
"1.1.0.1001 Build20210611",
6464
"1.0.0.1001 Build20210501"
6565
]
6666
}
67-
}
67+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"tszIPAddr": "127.0.0.1",
3+
"bDistributed": 1,
4+
"LBConfig": {
5+
"nServerMode": 1
6+
},
7+
"LoadBalance": {
8+
"nUseMode": [
9+
0
10+
],
11+
"CenterAddr": [
12+
"http://192.168.1.9:5100"
13+
],
14+
"DownloadAddr": [
15+
"http://192.168.1.9:5010"
16+
],
17+
"UPLoaderAddr": [
18+
"http://192.168.1.9:5102"
19+
]
20+
}
21+
}

XEngine_Release/XEngine_SQL/.gitignore

Whitespace-only changes.

XEngine_Source/Makefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,50 @@ UNICODE = 0
33

44
FLAGS = RELEASE=$(RELEASE)
55

6-
COMPONENTS_SQL_PATH = ./XEngine_StorageComponents/XStorage_SQLPacket
7-
COMPONENTS_PROTOCOL_PATH = ./XEngine_StorageComponents/XStorage_Protocol
6+
STORAGE_SQL_PATH = ./XEngine_StorageComponents/XStorage_SQLPacket
7+
STORAGE_PROTOCOL_PATH = ./XEngine_StorageComponents/XStorage_Protocol
8+
P2XP_PEER_PATH = ./XEngine_P2XPComponents/XEngine_P2XPPeer
9+
P2XP_PROTOCOL_PATH = ./XEngine_P2XPComponents/XEngine_P2XPProtocol
810

911
BASE_CONFIG_PATH = ./StorageModule_Config
1012
BASE_SESSION_PATH = ./StorageModule_Session
13+
BASE_APIHELP_PATH = ./StorageModule_APIHelp
1114

1215
APPSERVICE_STORAGE_PATH = ./XEngine_StorageApp
1316

1417
NETENGINE_LIB = libXStorage_SQLPacket.so libXStorage_Protocol.so \
15-
libStorageModule_Config.so libStorageModule_Session.so \
18+
libXEngine_P2XPPeer.so libXEngine_P2XPProtocol.so \
19+
libStorageModule_Config.so libStorageModule_Session.so libStorageModule_APIHelp.so \
1620
XEngine_StorageApp.exe
1721

1822
.PHONY:MakeAll
1923
MakeAll:$(NETENGINE_LIB)
2024

2125
libXStorage_SQLPacket.so:
22-
make -C $(COMPONENTS_SQL_PATH) $(FLAGS)
26+
make -C $(STORAGE_SQL_PATH) $(FLAGS)
2327
libXStorage_Protocol.so:
24-
make -C $(COMPONENTS_PROTOCOL_PATH) $(FLAGS)
28+
make -C $(STORAGE_PROTOCOL_PATH) $(FLAGS)
2529

30+
libXEngine_P2XPPeer.so:
31+
make -C $(P2XP_PEER_PATH) $(FLAGS)
32+
libXEngine_P2XPProtocol.so:
33+
make -C $(P2XP_PROTOCOL_PATH) $(FLAGS)
34+
2635
libStorageModule_Config.so:
2736
make -C $(BASE_CONFIG_PATH) $(FLAGS)
2837
libStorageModule_Session.so:
2938
make -C $(BASE_SESSION_PATH) $(FLAGS)
39+
libStorageModule_APIHelp.so:
40+
make -C $(BASE_APIHELP_PATH) $(FLAGS)
3041

3142
XEngine_StorageApp.exe:
3243
make -C $(APPSERVICE_STORAGE_PATH) $(FLAGS)
3344

34-
#安装开发包文件
45+
3546
SetFlags_Install:
3647
export FLAGS=InstallAll
3748
InstallAll:SetFlags_Install $(NETENGINE_LIB)
38-
#清除临时文件
49+
3950
SetFlags_Clean:
4051
export FLAGS=CleanAll
4152
CleanAll:SetFlags_Clean $(NETENGINE_LIB)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
/********************************************************************
3+
// Created: 2021/07/08 15:37:18
4+
// File Name: D:\XEngine_Storage\XEngine_Source\StorageModule_APIHelp\APIHelp_Define.h
5+
// File Path: D:\XEngine_Storage\XEngine_Source\StorageModule_APIHelp
6+
// File Base: APIHelp_Define
7+
// File Ext: h
8+
// Project: XEngine(网络通信引擎)
9+
// Author: qyt
10+
// Purpose: 导出定义
11+
// History:
12+
*********************************************************************/
13+
//////////////////////////////////////////////////////////////////////////
14+
// 导出函数
15+
//////////////////////////////////////////////////////////////////////////
16+
extern "C" DWORD StorageHelp_GetLastError(int* pInt_SysError = NULL);
17+
/************************************************************************/
18+
/* */
19+
/************************************************************************/
20+
extern "C" BOOL APIHelp_Distributed_IsMode(list<int>*pStl_ListMode, int nMode);
21+
extern "C" BOOL APIHelp_Distributed_RandomAddr(list<tstring>* pStl_ListAddr, TCHAR* ptszAddr);
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#include "pch.h"
2+
#include "APIHelp_Distributed.h"
3+
/********************************************************************
4+
// Created: 2021/07/08 15:26:13
5+
// File Name: D:\XEngine_Storage\XEngine_Source\StorageModule_APIHelp\APIHelp_Distributed\APIHelp_Distributed.cpp
6+
// File Path: D:\XEngine_Storage\XEngine_Source\StorageModule_APIHelp\APIHelp_Distributed
7+
// File Base: APIHelp_Distributed
8+
// File Ext: cpp
9+
// Project: XEngine(网络通信引擎)
10+
// Author: qyt
11+
// Purpose: 分布式帮助函数
12+
// History:
13+
*********************************************************************/
14+
CAPIHelp_Distributed::CAPIHelp_Distributed()
15+
{
16+
17+
}
18+
CAPIHelp_Distributed::~CAPIHelp_Distributed()
19+
{
20+
21+
}
22+
BOOL CAPIHelp_Distributed::APIHelp_Distributed_IsMode(list<int>* pStl_ListMode, int nMode)
23+
{
24+
BOOL bFound = FALSE;
25+
list<int>::const_iterator stl_ListIterator = pStl_ListMode->begin();
26+
for (; stl_ListIterator != pStl_ListMode->end(); stl_ListIterator++)
27+
{
28+
if (nMode == *stl_ListIterator)
29+
{
30+
bFound = TRUE;
31+
break;
32+
}
33+
}
34+
return bFound;
35+
}
36+
BOOL CAPIHelp_Distributed::APIHelp_Distributed_RandomAddr(list<tstring>* pStl_ListAddr, TCHAR* ptszAddr)
37+
{
38+
BOOL bFound = FALSE;
39+
XNETHANDLE xhToken = 0;
40+
41+
BaseLib_OperatorHandle_Create(&xhToken, 0, pStl_ListAddr->size(), FALSE);
42+
if (xhToken == pStl_ListAddr->size())
43+
{
44+
xhToken--;
45+
}
46+
list<tstring>::const_iterator stl_ListIterator = pStl_ListAddr->begin();
47+
for (XNETHANDLE i = 0; stl_ListIterator != pStl_ListAddr->end(); stl_ListIterator++, i++)
48+
{
49+
if (xhToken == i)
50+
{
51+
bFound = TRUE;
52+
_tcscpy(ptszAddr, stl_ListIterator->c_str());
53+
break;
54+
}
55+
}
56+
return bFound;
57+
}

0 commit comments

Comments
 (0)