Skip to content

Commit cb599f6

Browse files
committed
update:README
added:OPTIONS Method is supported.you can use to this methoed implement heartbeat
1 parent 0f9932d commit cb599f6

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

README.en.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ The Second pass is not realized by the server, it is by the client
8787
upload file second pass is first check the HASH file is on the server, if has file on the server, it will directly prompt the upload is successful.
8888
The realization of downloading second transmission is to first query the local file save path through HASH, and download it directly if it exists.
8989

90+
## 关于P2P
91+
the design and development of the P2P interface has been completed, and there is no time for verification and testing
92+
P2P distributed download has been supported, but currently only in the lan,cross-network segment is not supported for the time being, you need to wait for the development to be completed
93+
P2P distributed download is the same as the hyper-threaded download of other download tools. The principle is to use the HTTP RANGE field. You can implement this function through libraries such as libcurl.
94+
9095
## directory struct
9196
- XEngine_Docment docment directory
9297
- XEngine_Release install directory

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ make FLAGS=CleanAll 清理编译
9292
上传秒传的实现是先通过HASH查询文件是否在服务器,如果存在就不上传直接提示客户端上传成功.
9393
下载秒传的实现是先通过HASH查询本地文件保存路径,如果存在就直接下载完成.
9494

95+
## 关于P2P
96+
目前P2P接口已经完成设计和开发,还没有时间做验证和测试
97+
P2P分布式下载已经支持,不过目前只能在局域网中,暂时不支持跨网段,需要等待开发完毕
98+
P2P分布式下载与其他下载工具的超线程下载一样,原理是使用HTTP RANGE字段实现.各位可以通过libcurl等库实现此功能.
99+
95100
## 当前任务
96101
扩展管理接口
97102

XEngine_Source/XEngine_StorageApp/StorageApp_Center.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ BOOL XEngine_Task_HttpCenter(LPCTSTR lpszClientAddr, LPCTSTR lpszMsgBuffer, int
5757

5858
LPCTSTR lpszMethodPost = _T("POST");
5959
LPCTSTR lpszMethodGet = _T("GET");
60+
LPCTSTR lpszMethodOption = _T("OPTIONS");
61+
6062
if (0 == _tcsnicmp(lpszMethodPost, pSt_HTTPParam->tszHttpMethod, _tcslen(lpszMethodPost)))
6163
{
6264
if (!XEngine_APPHelp_ProxyAuth(lpszClientAddr, lpszMethodPost, pSt_HTTPParam->tszHttpUri, pptszListHdr, nHdrCount, STORAGE_NETTYPE_HTTPCENTER))
@@ -124,6 +126,16 @@ BOOL XEngine_Task_HttpCenter(LPCTSTR lpszClientAddr, LPCTSTR lpszMsgBuffer, int
124126
}
125127
XEngine_Task_P2PGet(pSt_HTTPParam->tszHttpUri + 1, lpszClientAddr, pSt_HTTPParam);
126128
}
129+
else if (0 == _tcsnicmp(lpszMethodOption, pSt_HTTPParam->tszHttpMethod, _tcslen(lpszMethodOption)))
130+
{
131+
//用于心跳
132+
st_HDRParam.bIsClose = TRUE;
133+
st_HDRParam.nHttpCode = 200;
134+
LPCTSTR lpszHdrBuffer = _T("Allow: POST OPTIONS\r\n");
135+
RfcComponents_HttpServer_SendMsgEx(xhCenterHttp, tszSDBuffer, &nSDLen, &st_HDRParam, NULL, 0, lpszHdrBuffer);
136+
XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER);
137+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("业务客户端:%s,请求OPTIONS心跳方法成功"), lpszClientAddr);
138+
}
127139
else
128140
{
129141
st_HDRParam.bIsClose = TRUE;

XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ int main(int argc, char** argv)
271271

272272
if (!NetCore_TCPXCore_StartEx(&xhNetDownload, st_ServiceCfg.nStorageDLPort, st_ServiceCfg.st_XMax.nMaxClient, st_ServiceCfg.st_XMax.nIOThread))
273273
{
274-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务器中,启动下载存储网络服务失败,端口:%d,错误:%lX"), st_ServiceCfg.nStorageDLPort, NetCore_GetLastError());
274+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("启动服务器中,启动下载存储网络服务失败,端口:%d,错误:%lX,%d"), st_ServiceCfg.nStorageDLPort, NetCore_GetLastError(), errno);
275275
goto XENGINE_EXITAPP;
276276
}
277277
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("启动服务中,启动下载存储网络服务成功,句柄:%llu,端口:%d,IO线程个数:%d"), xhNetDownload, st_ServiceCfg.nStorageDLPort, st_ServiceCfg.st_XMax.nIOThread);

0 commit comments

Comments
 (0)