Skip to content

Commit 100ca3f

Browse files
authored
Merge pull request #29 from libxengine/develop
V3.10.0.1001 Merge
2 parents cb8575f + b37ef2b commit 100ca3f

Some content is hidden

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

43 files changed

+571
-226
lines changed

CHANGELOG

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
XEngine_Storage V3.10.0.1001
2+
3+
增加:上传文件覆写功能
4+
增加:上传文件可以对不存在的文件夹设置是否创建的权限标记了
5+
增加:下载和上传连接限制功能
6+
优化:Session_UPStroage_Insert的多余参数
7+
修改:匹配XEngineV7.48版本
8+
修正:storagehelp的获取最后错误码不正确的问题
9+
修正:广播查询文件不正确的问题
10+
修正:没有响应消息当存储的bucket名称不存在时
11+
12+
added:rewrite file choice support
13+
added:upload file can be set permission when path not exist
14+
added:download and upload connect limit
15+
improved:Session_UPStroage_Insert function parament
16+
modify:match xengine v7.48
17+
fixed:storeagehelp get last error is incorrent
18+
fixed:broadcast query file is incorrent
19+
fixed:does not reply http message when storeage key notfound
20+
======================================================================================
121
XEngine_Storage V3.9.1.1001
222

323
修改:p2p广播的每个请求都可以被区分了

README.en.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ feature list:
3030
13. support second pass and Resumable
3131
14. support upload and download Redirect
3232
15. support full speed and limit speed
33+
16. permission control
34+
17. upload file rewrite
3335

3436
## install
3537

@@ -94,12 +96,20 @@ Download File: curl -X GET "http://192.168.1.8:5101/storagekey1/hello.txt"
9496
## now task
9597
P2P WAN file search and download support
9698

99+
## Installation Instructions
100+
#### Install
101+
Modify the configuration file to what you need, and then run the service directly
102+
Advanced functions require the support of MYSQL. After installing MYSQL, import XEngine_SQLFile/XStorage_Create.sql and then import XEngine_Storage.sql.
103+
#### upgrade
104+
If it is an upgrade installation, after downloading the new version and modifying the configuration file, it can be run directly
105+
If you use a database, you need to open the database matching fields and tables are consistent
106+
97107
## other problems
98108
You can refer to the document under the docment directory. It contains API protocol and service description.
99109
When the jsoncpp module is used, the compilation runtime library selection must be consistent
100110

101111
## Test Service
102-
Address:app.xyry.org or 159.75.200.173
112+
Address:app.xyry.org
103113
Port:HTTP Center Port 5100,Download 5101,UPLoad 5102
104114

105115
## Participate in contribution

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ c c++ file storage service
2929
13. 支持秒传和断点续传
3030
14. 支持上传和下载重定向
3131
15. 支持全速模式和限速模式
32+
16. 权限控制
33+
17. 上传文件覆写
3234

3335
## 安装教程
3436

@@ -90,19 +92,24 @@ make FLAGS=CleanAll 清理编译
9092
P2P分布式下载已经支持,不过目前只能在局域网中,暂时不支持跨网段,需要等待开发完毕
9193
P2P分布式下载与其他下载工具的超线程下载一样,原理是使用HTTP RANGE字段实现.各位可以通过libcurl等库实现此功能.
9294

93-
## 当前任务
94-
本地网络接口删除
95-
上传目录控制,防止超过权限的上传动作
96-
客户端连接数限制
95+
## 当前任务
9796
P2P广域网文件查找与下载支持
9897
分布式数据库存储
9998

99+
## 安装指导
100+
#### 安装
101+
修改配置文件为你需要的,然后直接运行服务即可
102+
高级功能需要MYSQL的支持,安装完毕MYSQL后导入XEngine_SQLFile/XStorage_Create.sql 然后导入 XEngine_Storage.sql即可.
103+
#### 升级
104+
如果是升级安装,下载新版本后修改配置文件就可以直接运行了
105+
如果使用了数据库,需要打开数据库匹配字段和表是否一致
106+
100107
## 其他问题
101108
你可以参考docment目录下的文档.里面包含了API协议和服务说明.
102109
jsoncpp模块在使用的时候编译运行时库选择必须一致.否则会崩溃.
103110

104111
## 测试服务器
105-
地址:app.xyry.org 或者 159.75.200.173
112+
地址:app.xyry.org
106113
端口:HTTP业务端口 5100,下载 5101,上传 5102
107114

108115
## 参与贡献

XEngine_APPClient/APPClient_Download/APPClient_Download.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
#include <windows.h>
77
#include <tchar.h>
88
#pragma comment(lib,"x86/XEngine_BaseLib/XEngine_BaseLib")
9-
#pragma comment(lib,"x86/XEngine_NetHelp/NetHelp_APIHelp")
10-
#pragma comment(lib,"x86/XEngine_DownLoad/XEngine_DownLoad")
9+
#pragma comment(lib,"x86/XEngine_NetHelp/NetHelp_APIClient")
1110
#pragma comment(lib,"x86/XEngine_SystemSdk/XEngine_SystemApi")
1211
#pragma comment(lib,"Ws2_32")
1312
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
@@ -21,10 +20,8 @@
2120
#include <XEngine_Include/XEngine_ProtocolHdr.h>
2221
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2322
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
24-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
25-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
26-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Define.h>
27-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Error.h>
23+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
24+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2825
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
2926
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
3027
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>
@@ -33,12 +30,13 @@ using namespace std;
3330

3431
//需要优先配置XEngine
3532
//WINDOWS使用VS2022 x86 debug 编译
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
33+
//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
34+
//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
3835

3936
typedef struct
4037
{
4138
XENGINE_PROTOCOL_FILE st_ProtocolFile;
39+
CHAR tszBuckKey[128];
4240
CHAR tszIPAddr[64];
4341
}P2PFILE_INFO;
4442

@@ -72,6 +70,7 @@ void P2PParse_List(LPCTSTR lpszMsgBuffer, int nMsgLen, list<P2PFILE_INFO>* pStl_
7270
_tcscpy(st_P2PFile.st_ProtocolFile.tszFileTime, st_JsonArray[i]["tszFileTime"].asCString());
7371
_tcscpy(st_P2PFile.st_ProtocolFile.tszFileUser, st_JsonArray[i]["tszFileUser"].asCString());
7472
_tcscpy(st_P2PFile.tszIPAddr, st_JsonArray[i]["tszTableName"].asCString());
73+
_tcscpy(st_P2PFile.tszBuckKey, st_JsonArray[i]["tszBuckKey"].asCString());
7574

7675
pStl_ListFile->push_back(st_P2PFile);
7776
}
@@ -87,9 +86,9 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
8786
{
8887
P2PFILE_PIECE* pSt_P2PFile = new P2PFILE_PIECE[pStl_ListFile->size()];
8988

90-
int nPos = 0;
89+
__int64x nPos = 0;
9190
//得到每个块大小
92-
int nPiece = pStl_ListFile->front().st_ProtocolFile.nFileSize / pStl_ListFile->size();
91+
__int64x nPiece = pStl_ListFile->front().st_ProtocolFile.nFileSize / pStl_ListFile->size();
9392
//这是一个简单的分布式块算法示例.怎么做分布式,可以根据自己需求做算法拆解
9493
list<P2PFILE_INFO>::const_iterator stl_ListIterator = pStl_ListFile->begin();
9594
for (int i = 0; stl_ListIterator != pStl_ListFile->end(); stl_ListIterator++, i++)
@@ -100,7 +99,7 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
10099
memset(tszDLUrl, '\0', sizeof(tszDLUrl));
101100
memset(tszRange, '\0', sizeof(tszRange));
102101

103-
_stprintf(tszDLUrl, _T("%s/%s/%s"), stl_ListIterator->tszIPAddr, stl_ListIterator->st_ProtocolFile.tszFilePath + 2, stl_ListIterator->st_ProtocolFile.tszFileName);
102+
_stprintf(tszDLUrl, _T("%s/%s/%s"), stl_ListIterator->tszIPAddr, stl_ListIterator->tszBuckKey, stl_ListIterator->st_ProtocolFile.tszFileName);
104103
//是否是最后一块
105104
if ((int)pStl_ListFile->size() == (i + 1))
106105
{
@@ -115,23 +114,24 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
115114
nPos += nPiece;
116115
_stprintf(tszRange, _T("%lld-%lld"), pSt_P2PFile[i].nPosStart, pSt_P2PFile[i].nPosEnd);
117116
}
118-
pSt_P2PFile[i].xhToken = DownLoad_Http_Create(tszDLUrl, lpszFile, tszRange, NULL, NULL, NULL);
117+
pSt_P2PFile[i].xhToken = APIClient_File_Create(tszDLUrl, lpszFile, TRUE, tszRange);
119118
if (NULL == pSt_P2PFile[i].xhToken)
120119
{
121-
printf("create download task is failed:%X\n", Download_GetLastError());
120+
printf("create download task is failed:%X\n", APIClient_GetLastError());
122121
}
122+
APIClient_File_Start(pSt_P2PFile[i].xhToken);
123123
}
124124
//直到所有完成
125125
while (1)
126126
{
127127
BOOL bComplete = TRUE;
128128
for (unsigned int i = 0; i < pStl_ListFile->size(); i++)
129129
{
130-
NETDOWNLOAD_TASKINFO st_TaskInfo;
131-
memset(&st_TaskInfo, '\0', sizeof(NETDOWNLOAD_TASKINFO));
130+
NETHELP_FILEINFO st_TaskInfo;
131+
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
132132

133-
DownLoad_Http_Query(pSt_P2PFile[i].xhToken, &st_TaskInfo);
134-
if (ENUM_XENGINE_DOWNLOAD_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
133+
APIClient_File_Query(pSt_P2PFile[i].xhToken, &st_TaskInfo);
134+
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_COMPLETE != st_TaskInfo.en_DownStatus)
135135
{
136136
bComplete = FALSE;
137137
}
@@ -146,7 +146,7 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
146146

147147
for (unsigned int i = 0; i < pStl_ListFile->size(); i++)
148148
{
149-
DownLoad_Http_Delete(pSt_P2PFile[i].xhToken);
149+
APIClient_File_Delete(pSt_P2PFile[i].xhToken);
150150
}
151151
delete[] pSt_P2PFile;
152152
pSt_P2PFile = NULL;
@@ -170,9 +170,9 @@ int main()
170170
st_JsonRoot["nMode"] = 1; //使用P2P下载
171171
st_JsonRoot["lpszBuckKey"] = "storagekey2";
172172
//st_JsonRoot["lpszFileName"] = "qq.exe";
173-
st_JsonRoot["lpszFileHash"] = "D41D8CD98F00B204E9801998ECF8427E";
173+
st_JsonRoot["lpszFileHash"] = "781E5E245D69B566979B86E28D23F2C7";
174174

175-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBody, &nBodyLen))
175+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBody, &nBodyLen))
176176
{
177177
return -1;
178178
}

XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <tchar.h>
44
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
55
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
6-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp")
6+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
77
#pragma comment(lib,"Ws2_32")
88
#endif
99
#include <stdio.h>
@@ -16,15 +16,15 @@
1616
#include <XEngine_Include/XEngine_ProtocolHdr.h>
1717
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1818
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
19-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
20-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
19+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
20+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2121
using namespace std;
2222

23-
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIHelp -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
23+
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -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
2424
//需要优先配置XEngine
2525
//WINDOWS使用VS2022 x86 debug 编译
2626
//linux使用下面的命令编译
27-
//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_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIHelp -ljsoncpp
27+
//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_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp
2828

2929
//查询
3030
void API_Manage_Query()
@@ -38,9 +38,9 @@ void API_Manage_Query()
3838
st_JsonRoot["lpszTimeEnd"];
3939
st_JsonRoot["lpszBuckKey"] = "storagekey2";
4040

41-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
41+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
4242
{
43-
printf("API_Manage_Query:%lX\n", APIHelp_GetLastError());
43+
printf("API_Manage_Query:%lX\n", APIClient_GetLastError());
4444
return;
4545
}
4646
printf("API_Manage_Query:%d,%s\n", nCode, ptszMsgBuffer);
@@ -66,9 +66,9 @@ void API_Manage_Insert()
6666
st_JsonRoot["List"] = st_JsonArray;
6767
st_JsonRoot["Count"] = 1;
6868

69-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
69+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
7070
{
71-
printf("API_Manage_Insert:%lX\n", APIHelp_GetLastError());
71+
printf("API_Manage_Insert:%lX\n", APIClient_GetLastError());
7272
return;
7373
}
7474
printf("API_Manage_Insert:%d,%s\n", nCode, ptszMsgBuffer);
@@ -91,9 +91,9 @@ void API_Manage_Delete()
9191
st_JsonRoot["List"] = st_JsonArray;
9292
st_JsonRoot["Count"] = 1;
9393

94-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
94+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
9595
{
96-
printf("API_Manage_Delete:%lX\n", APIHelp_GetLastError());
96+
printf("API_Manage_Delete:%lX\n", APIClient_GetLastError());
9797
return;
9898
}
9999
printf("API_Manage_Delete:%d,%s\n", nCode, ptszMsgBuffer);
@@ -111,9 +111,9 @@ void API_Manage_Dir()
111111
st_JsonRoot["lpszBuckKey"] = "storagekey1";
112112
st_JsonRoot["lpszUserDir"] = "user";
113113
st_JsonRoot["nOPerator"] = 1;
114-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
114+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
115115
{
116-
printf("API_Manage_Dir:%lX\n", APIHelp_GetLastError());
116+
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
117117
return;
118118
}
119119
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
@@ -123,9 +123,9 @@ void API_Manage_Dir()
123123
st_JsonRoot["lpszBuckKey"] = "storagekey1";
124124
st_JsonRoot["lpszUserDir"];
125125
st_JsonRoot["nOPerator"] = 0;
126-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
126+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
127127
{
128-
printf("API_Manage_Dir:%lX\n", APIHelp_GetLastError());
128+
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
129129
return;
130130
}
131131
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
@@ -135,9 +135,9 @@ void API_Manage_Dir()
135135
st_JsonRoot["lpszBuckKey"] = "storagekey1";
136136
st_JsonRoot["lpszUserDir"] = "user";
137137
st_JsonRoot["nOPerator"] = 2;
138-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
138+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
139139
{
140-
printf("API_Manage_Dir:%lX\n", APIHelp_GetLastError());
140+
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
141141
return;
142142
}
143143
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
@@ -150,9 +150,9 @@ void API_Manage_Task()
150150
int nLen = 0;
151151
int nCode = 0;
152152
TCHAR* ptszMsgBuffer = NULL;
153-
if (!APIHelp_HttpRequest_Custom(_T("POST"), lpszUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
153+
if (!APIClient_Http_Request(_T("POST"), lpszUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
154154
{
155-
printf("API_Manage_Task:%lX\n", APIHelp_GetLastError());
155+
printf("API_Manage_Task:%lX\n", APIClient_GetLastError());
156156
return;
157157
}
158158
printf("API_Manage_Task:%d,%s\n", nCode, ptszMsgBuffer);

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ int main(int argc, char** argv)
1313
TCHAR* ptszMsgBuffer = NULL;
1414
int nMsgLen = 0;
1515

16-
if (!APIHelp_HttpRequest_Custom(_T("GET"), lpszDownload, NULL, NULL, &ptszMsgBuffer, &nMsgLen))
16+
if (!APIClient_Http_Request(_T("GET"), lpszDownload, NULL, NULL, &ptszMsgBuffer, &nMsgLen))
1717
{
18-
printf("APIHelp_HttpRequest_Custom:%lX\n", APIHelp_GetLastError());
18+
printf("APIHelp_HttpRequest_Custom:%lX\n", APIClient_GetLastError());
1919
return 0;
2020
}
2121
string m_StrDes;
@@ -72,26 +72,27 @@ int main(int argc, char** argv)
7272
for (; stl_ListIterator != stl_ListUPDate.end(); stl_ListIterator++)
7373
{
7474
TCHAR tszPathFile[1024];
75-
NETDOWNLOAD_TASKINFO st_TaskInfo;
75+
NETHELP_FILEINFO st_TaskInfo;
7676

7777
memset(tszPathFile, '\0', sizeof(tszPathFile));
78-
memset(&st_TaskInfo, '\0', sizeof(NETDOWNLOAD_TASKINFO));
78+
memset(&st_TaskInfo, '\0', sizeof(NETHELP_FILEINFO));
7979

8080
_stprintf_s(tszPathFile, _T("%s%s"), stl_ListIterator->tszModulePath, stl_ListIterator->tszModuleName);
8181
_tremove(tszPathFile);
82-
XHANDLE xhDown = DownLoad_Http_Create(stl_ListIterator->tszModuleDownload, tszPathFile);
82+
XHANDLE xhDown = APIClient_File_Create(stl_ListIterator->tszModuleDownload, tszPathFile);
83+
APIClient_File_Start(xhDown);
8384
while (TRUE)
8485
{
85-
if (!DownLoad_Http_Query(xhDown, &st_TaskInfo))
86+
if (!APIClient_File_Query(xhDown, &st_TaskInfo))
8687
{
8788
break;
8889
}
89-
if (ENUM_XENGINE_DOWNLOAD_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
90+
if (ENUM_NETHELP_APICLIENT_FILE_STATUS_DOWNLOADDING != st_TaskInfo.en_DownStatus)
9091
{
9192
break;
9293
}
9394
}
94-
DownLoad_Http_Delete(xhDown);
95+
APIClient_File_Delete(xhDown);
9596
}
9697

9798
if (!HelpModule_Api_Copy(&stl_ListUPDate))

XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPHdr.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#pragma comment(lib,"Ws2_32.lib")
55
#pragma comment(lib,"../../../XEngine_Source/Debug/jsoncpp")
66
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib")
7-
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIHelp.lib")
8-
#pragma comment(lib,"XEngine_DownLoad/XEngine_DownLoad.lib")
7+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient.lib")
98
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib")
109
#endif
1110
#include <stdio.h>
@@ -21,10 +20,8 @@ using namespace std;
2120
#include <XEngine_Include/XEngine_Types.h>
2221
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
2322
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
24-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Define.h>
25-
#include <XEngine_Include/XEngine_NetHelp/APIHelp_Error.h>
26-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Define.h>
27-
#include <XEngine_Include/XEngine_DownLoad/DownLoad_Error.h>
23+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Define.h>
24+
#include <XEngine_Include/XEngine_NetHelp/APIClient_Error.h>
2825
#include <XEngine_Include/XEngine_SystemSdk/ProcFile_Define.h>
2926
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Define.h>
3027
#include <XEngine_Include/XEngine_SystemSdk/SystemApi_Error.h>

0 commit comments

Comments
 (0)