Skip to content

Commit 8f9d6c0

Browse files
authored
Merge pull request #12 from libxengine/develop
V2.4 Version merge
2 parents 6acb42f + 2ceca68 commit 8f9d6c0

File tree

29 files changed

+413
-481
lines changed

29 files changed

+413
-481
lines changed

README.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ feature list:
2929
13. support second pass and Resumable
3030
14. support nginx upload module proxy_pass
3131
15. support upload and download Redirect
32-
16. dynamic rate of the download
32+
16. support full speed and limit speed
3333

3434
## install
3535

@@ -98,8 +98,7 @@ P2P distributed download is the same as the hyper-threaded download of other dow
9898

9999
## now task
100100
P2P WAN file search and download support
101-
file send use system event
102-
Download speed limit optimization
101+
upload file code optimization
103102

104103
## other problems
105104
You can refer to the document under the docment directory. It contains API protocol and service description.
@@ -113,6 +112,7 @@ You can refer to the document under the docment directory. It contains API proto
113112

114113
## Clean up statement
115114
the software will not generate any files to other directories in your system.
115+
the software will not modify any of your system configuration.
116116
the software can achieve complete cleanup by directly delete the directory.
117117

118118
## Follow us

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ c c++ file storage service
2828
13. 支持秒传和断点续传
2929
14. 支持NGINX UPLOAD MODULE上传代理
3030
15. 支持上传和下载重定向
31-
16. 下载动态速率
31+
16. 支持全速模式和限速模式
3232

3333
## 安装教程
3434

@@ -96,8 +96,7 @@ P2P分布式下载与其他下载工具的超线程下载一样,原理是使用H
9696

9797
## 当前任务
9898
P2P广域网文件查找与下载支持
99-
文件发送使用系统事件
100-
下载限速优化
99+
文件上传代码优化
101100

102101
## 其他问题
103102
你可以参考docment目录下的文档.里面包含了API协议和服务说明.
@@ -111,6 +110,7 @@ P2P广域网文件查找与下载支持
111110

112111
## 绿色声明
113112
此软件不会产生任何文件到你的系统的其他目录中.
113+
此软件不会修改你的任何系统配置.
114114
此软件可通过直接删除主目录而达到完全清理目的.
115115

116116
## 关注我们

XEngine_Docment/Docment_en.docx

54 Bytes
Binary file not shown.

XEngine_Docment/Docment_zh.docx

126 Bytes
Binary file not shown.

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"SQLPass": "123123Ruiyue"
3737
},
3838
"XStorage": {
39+
"nSendMode": 2,
3940
"nHashMode": 2,
4041
"bRename": 0,
4142
"tszFileDir": "/home/ubuntu/桌面/XEngine_Storage/XEngine_Source/Debug/XEngine_File"
@@ -54,10 +55,9 @@
5455
}
5556
},
5657
"XLimit": {
57-
"nDLTry": 100,
58-
"nDLError": 10,
59-
"nMaxUPLoad": 1024000,
60-
"nMaxDNLoad": 10240000
58+
"nDLTry": 10,
59+
"nMaxUPLoad": 4096000,
60+
"nMaxDNLoad": 4096000
6161
},
6262
"XP2xp": {
6363
"nMode": 2,
@@ -68,6 +68,7 @@
6868
},
6969
"XVer": {
7070
"StorageVersion": [
71+
"2.4.0.1001 Build20210917",
7172
"2.3.0.1001 Build20210903",
7273
"2.2.0.1001 Build20210820",
7374
"2.1.0.1001 Build20210805",

XEngine_Source/StorageModule_Config/Config_Define.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ typedef struct tag_XEngine_ServerConfig
6464
struct
6565
{
6666
BOOL bRename;
67+
int nSendMode;
6768
int nHashMode;
6869
TCHAR tszFileDir[MAX_PATH];
6970
}st_XStorage;
@@ -86,7 +87,6 @@ typedef struct tag_XEngine_ServerConfig
8687
struct
8788
{
8889
int nDLTry;
89-
int nDLError;
9090
__int64x nMaxUPLoader;
9191
__int64x nMaxDNLoader;
9292
}st_XLimit;

XEngine_Source/StorageModule_Config/Config_Json/Config_Json.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,15 @@ 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() || (3 != st_JsonRoot["XStorage"].size()))
128+
if (st_JsonRoot["XStorage"].empty() || (4 != st_JsonRoot["XStorage"].size()))
129129
{
130130
Config_IsErrorOccur = TRUE;
131131
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_XSTORAGE;
132132
return FALSE;
133133
}
134134
Json::Value st_JsonXStorage = st_JsonRoot["XStorage"];
135135
pSt_ServerConfig->st_XStorage.nHashMode = st_JsonXStorage["nHashMode"].asInt();
136+
pSt_ServerConfig->st_XStorage.nSendMode = st_JsonXStorage["nSendMode"].asInt();
136137
pSt_ServerConfig->st_XStorage.bRename = st_JsonXStorage["bRename"].asInt();
137138
_tcscpy(pSt_ServerConfig->st_XStorage.tszFileDir, st_JsonXStorage["tszFileDir"].asCString());
138139

@@ -155,15 +156,14 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
155156
_tcscpy(pSt_ServerConfig->st_XProxy.st_XProxyPass.tszDLPass, st_JsonXProxyPass["tszDLPass"].asCString());
156157
_tcscpy(pSt_ServerConfig->st_XProxy.st_XProxyPass.tszUPPass, st_JsonXProxyPass["tszUPPass"].asCString());
157158

158-
if (st_JsonRoot["XLimit"].empty() || (4 != st_JsonRoot["XLimit"].size()))
159+
if (st_JsonRoot["XLimit"].empty() || (3 != st_JsonRoot["XLimit"].size()))
159160
{
160161
Config_IsErrorOccur = TRUE;
161162
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_XSTORAGE;
162163
return FALSE;
163164
}
164165
Json::Value st_JsonXLimit = st_JsonRoot["XLimit"];
165166
pSt_ServerConfig->st_XLimit.nDLTry = st_JsonXLimit["nDLTry"].asUInt();
166-
pSt_ServerConfig->st_XLimit.nDLError = st_JsonXLimit["nDLError"].asUInt();
167167
pSt_ServerConfig->st_XLimit.nMaxDNLoader = st_JsonXLimit["nMaxDNLoad"].asInt64();
168168
pSt_ServerConfig->st_XLimit.nMaxUPLoader = st_JsonXLimit["nMaxUPLoad"].asInt64();
169169

XEngine_Source/StorageModule_Session/Session_Define.h

Lines changed: 16 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,14 @@
1515
//////////////////////////////////////////////////////////////////////////
1616
typedef struct
1717
{
18-
ULONGLONG ullTimeSend; //最后发送时间
19-
ULONGLONG ullTimeWait; //等待恢复时间,单位毫秒
20-
time_t nTimeError; //最后错误时间
21-
int nErrorCount; //错误次数
22-
int nAutoNumber; //恢复次数
23-
}SESSION_STORAGEDYNAMICRATE;
24-
typedef struct
25-
{
26-
SESSION_STORAGEDYNAMICRATE st_DynamicRate;
2718
TCHAR tszFileDir[MAX_PATH]; //文件地址
2819
TCHAR tszClientAddr[128]; //操作的用户地址
2920
__int64x ullCount; //总大小
3021
__int64x ullRWCount; //读取(写入)总大小
3122
__int64x ullRWLen; //已经读取(写入)的大小
3223
__int64x ullPosStart; //开始位置
3324
__int64x ullPosEnd; //结束位置
34-
int nPoolIndex; //任务池索引
25+
int nErrorTime; //错误次数
3526
FILE* pSt_File;
3627
}SESSION_STORAGEINFO;
3728
//////////////////////////////////////////////////////////////////////////
@@ -89,27 +80,17 @@ extern "C" BOOL Session_User_Exist(LPCTSTR lpszUser, LPCTSTR lpszPass);
8980
/********************************************************************
9081
函数名称:Session_DLStroage_Init
9182
函数功能:初始化下载会话管理器
92-
参数.一:nPoolCount
93-
In/Out:In
94-
类型:整数型
95-
可空:N
96-
意思:输入最大运行多少个下载同时进行
97-
参数.二:nTryTime
98-
In/Out:In
99-
类型:整数型
100-
可空:Y
101-
意思:输入重试次数
102-
参数.三:nAutoSpeed
83+
参数.一:nTryTime
10384
In/Out:In
10485
类型:整数型
10586
可空:Y
106-
意思:输入恢复次数,超过次数不在恢复
87+
意思:输入下载错误重试次数
10788
返回值
10889
类型:逻辑型
10990
意思:是否成功
11091
备注:
11192
*********************************************************************/
112-
extern "C" BOOL Session_DLStroage_Init(int nPoolCount = 1, int nTryTime = 3, int nAutoSpeed = 3);
93+
extern "C" BOOL Session_DLStroage_Init(int nTryTime = 3);
11394
/********************************************************************
11495
函数名称:Session_DLStroage_Destory
11596
函数功能:销毁下载管理器
@@ -161,21 +142,16 @@ extern "C" BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFil
161142
/********************************************************************
162143
函数名称:Session_DLStroage_GetBuffer
163144
函数功能:获得下载器中指定缓冲区
164-
参数.一:nPool
165-
In/Out:In
166-
类型:整数型
167-
可空:N
168-
意思:输入要操作的队列
169-
参数.二:lpszClientAddr
145+
参数.一:lpszClientAddr
170146
In/Out:In
171147
类型:常量字符指针
172148
可空:N
173149
意思:输入客户端地址
174-
参数.:ptszMsgBuffer
150+
参数.:ptszMsgBuffer
175151
In/Out:In
176152
类型:字符指针
177153
可空:N
178-
参数.:pInt_MsgLen
154+
参数.:pInt_MsgLen
179155
In/Out:In
180156
类型:整数型指针
181157
可空:N
@@ -185,21 +161,16 @@ extern "C" BOOL Session_DLStroage_Insert(LPCTSTR lpszClientAddr, LPCTSTR lpszFil
185161
意思:是否成功
186162
备注:
187163
*********************************************************************/
188-
extern "C" BOOL Session_DLStroage_GetBuffer(int nPool, LPCTSTR lpszClientAddr, TCHAR * ptszMsgBuffer, int* pInt_MsgLen);
164+
extern "C" BOOL Session_DLStroage_GetBuffer(LPCTSTR lpszClientAddr, TCHAR * ptszMsgBuffer, int* pInt_MsgLen);
189165
/********************************************************************
190166
函数名称:Session_DLStroage_GetInfo
191167
函数功能:获取下载信息
192-
参数.一:nPool
193-
In/Out:In
194-
类型:整数型
195-
可空:N
196-
意思:输入要操作的下载池
197-
参数.二:lpszClientAddr
168+
参数.一:lpszClientAddr
198169
In/Out:In
199170
类型:常量字符指针
200171
可空:N
201172
意思:输入要操作的客户端
202-
参数.:pSt_StorageInfo
173+
参数.:pSt_StorageInfo
203174
In/Out:Out
204175
类型:数据结构指针
205176
可空:N
@@ -209,26 +180,21 @@ extern "C" BOOL Session_DLStroage_GetBuffer(int nPool, LPCTSTR lpszClientAddr, T
209180
意思:是否成功
210181
备注:
211182
*********************************************************************/
212-
extern "C" BOOL Session_DLStroage_GetInfo(int nPool, LPCTSTR lpszClientAddr, SESSION_STORAGEINFO* pSt_StorageInfo);
183+
extern "C" BOOL Session_DLStroage_GetInfo(LPCTSTR lpszClientAddr, SESSION_STORAGEINFO* pSt_StorageInfo);
213184
/********************************************************************
214185
函数名称:Session_DLStroage_GetCount
215186
函数功能:获取队列拥有的个数
216-
参数.一:nPool
217-
In/Out:In
218-
类型:整数型
219-
可空:N
220-
意思:输入要操作的队列
221-
参数.二:pStl_ListClient
187+
参数.一:pInt_ListCount
222188
In/Out:Out
223-
类型:STL容器指针
189+
类型:整数型
224190
可空:N
225191
意思:输出要发送的队列个数
226192
返回值
227193
类型:逻辑型
228194
意思:是否成功
229195
备注:
230196
*********************************************************************/
231-
extern "C" BOOL Session_DLStroage_GetCount(int nPool, list<string>*pStl_ListClient);
197+
extern "C" BOOL Session_DLStroage_GetCount(int* pInt_ListCount);
232198
/********************************************************************
233199
函数名称:Session_DLStorage_SetSeek
234200
函数功能:移动文件指针
@@ -246,18 +212,13 @@ extern "C" BOOL Session_DLStroage_GetCount(int nPool, list<string>*pStl_ListClie
246212
In/Out:In
247213
类型:逻辑型
248214
可空:Y
249-
意思:是否因为错误引起的
250-
参数.四:pSt_StorageRate
251-
In/Out:In
252-
类型:数据结构指针
253-
可空:Y
254-
意思:输出速率错误信息
215+
意思:是否有由错误引起的
255216
返回值
256217
类型:逻辑型
257218
意思:是否成功
258219
备注:
259220
*********************************************************************/
260-
extern "C" BOOL Session_DLStorage_SetSeek(LPCTSTR lpszClientAddr, int nSeek, BOOL bError = TRUE, SESSION_STORAGEDYNAMICRATE * pSt_StorageRate = NULL);
221+
extern "C" BOOL Session_DLStorage_SetSeek(LPCTSTR lpszClientAddr, int nSeek, BOOL bError = TRUE);
261222
/********************************************************************
262223
函数名称:Session_DLStorage_GetAll
263224
函数功能:获取下载池的任务列表

XEngine_Source/StorageModule_Session/Session_Error.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
#define ERROR_STORAGE_MODULE_SESSION_OPENFILE 0x0010003
1919
#define ERROR_STORAGE_MODULE_SESSION_NOTFOUND 0x0010004
2020
#define ERROR_STORAGE_MODULE_SESSION_PASSWORD 0x0010005
21-
#define ERROR_STORAGE_MODULE_SESSION_EMPTY 0x0010006
21+
#define ERROR_STORAGE_MODULE_SESSION_EMPTY 0x0010006
22+
#define ERROR_STORAGE_MODULE_SESSION_ERRORTIME 0x0010007

0 commit comments

Comments
 (0)