Skip to content

Commit 8c6d9e0

Browse files
committed
modify:Adjust the waiting time calculation method
1 parent de3befb commit 8c6d9e0

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"XStorage": {
3939
"nHashMode": 2,
40-
"nSendMode": 1,
40+
"nSendMode": 2,
4141
"bRename": 0,
4242
"tszFileDir": "/home/ubuntu/桌面/XEngine_Storage/XEngine_Source/Debug/XEngine_File"
4343
},
@@ -82,4 +82,4 @@
8282
"1.0.0.1001 Build20210501"
8383
]
8484
}
85-
}
85+
}

XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ BOOL CSession_DLStroage::Session_DLStroage_GetCount(int nPool, list<string>* pSt
429429
//printf("nAutoNumber:%d <= m_nTryAuto:%d,nTimeNow:%lu - nTimeError:%lu nErrorCount:%d\n", stl_ListIterator->st_DynamicRate.nAutoNumber, m_nTryAuto, nTimeNow, stl_ListIterator->st_DynamicRate.nTimeError, stl_ListIterator->st_DynamicRate.nErrorCount * stl_ListIterator->st_DynamicRate.nAutoNumber);
430430
stl_ListIterator->st_DynamicRate.nAutoNumber++;
431431
stl_ListIterator->st_DynamicRate.nErrorCount--;
432-
stl_ListIterator->st_DynamicRate.ullTimeWait -= XENGINE_STOREAGE_SESSION_DOWNLOAD_SENDTIME;
432+
stl_ListIterator->st_DynamicRate.ullTimeWait -= (XENGINE_STOREAGE_SESSION_DOWNLOAD_SENDTIME * stl_ListIterator->st_DynamicRate.nTimeError);
433433
if (0 == stl_ListIterator->st_DynamicRate.nErrorCount)
434434
{
435435
stl_ListIterator->st_DynamicRate.nTimeError = 0;
@@ -499,7 +499,7 @@ BOOL CSession_DLStroage::Session_DLStorage_SetSeek(LPCTSTR lpszClientAddr, int n
499499
{
500500
stl_ListIterator->st_DynamicRate.nErrorCount++;
501501
stl_ListIterator->st_DynamicRate.nTimeError = time(NULL);
502-
stl_ListIterator->st_DynamicRate.ullTimeWait += XENGINE_STOREAGE_SESSION_DOWNLOAD_SENDTIME;
502+
stl_ListIterator->st_DynamicRate.ullTimeWait += (XENGINE_STOREAGE_SESSION_DOWNLOAD_SENDTIME * stl_ListIterator->st_DynamicRate.nTimeError);
503503
}
504504
if (NULL != pSt_StorageRate)
505505
{

XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,7 @@ BOOL XEngine_Task_HttpDownload(LPCTSTR lpszClientAddr, LPCTSTR lpszMsgBuffer, in
256256
}
257257
BOOL XEngine_Task_SendDownload(LPCTSTR lpszClientAddr, LPCTSTR lpszMsgBuffer, int nMsgLen)
258258
{
259-
if (XEngine_Net_SendMsg(lpszClientAddr, lpszMsgBuffer, nMsgLen, STORAGE_NETTYPE_HTTPDOWNLOAD))
260-
{
261-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG, _T("下载客户端:%s,正在发送文件数据,大小:%d"), lpszClientAddr, nMsgLen);
262-
}
263-
else
259+
if (!XEngine_Net_SendMsg(lpszClientAddr, lpszMsgBuffer, nMsgLen, STORAGE_NETTYPE_HTTPDOWNLOAD))
264260
{
265261
SESSION_STORAGEDYNAMICRATE st_StorageRate;
266262
memset(&st_StorageRate, '\0', sizeof(SESSION_STORAGEDYNAMICRATE));
@@ -274,6 +270,8 @@ BOOL XEngine_Task_SendDownload(LPCTSTR lpszClientAddr, LPCTSTR lpszMsgBuffer, in
274270
XEngine_Net_CloseClient(lpszClientAddr, STORAGE_LEAVETYPE_CLOSE, STORAGE_NETTYPE_HTTPDOWNLOAD);
275271
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _T("下载客户端:%s,正在发送文件数据,大小:%d,发送超过重试次数,无法继续,移除发送队列,错误次数:%d,等待时间:%llu 微妙,恢复次数:%d"), lpszClientAddr, nMsgLen, st_StorageRate.nErrorCount, st_StorageRate.ullTimeWait, st_StorageRate.nAutoNumber);
276272
}
273+
return FALSE;
277274
}
275+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG, _T("下载客户端:%s,正在发送文件数据,大小:%d"), lpszClientAddr, nMsgLen);
278276
return TRUE;
279277
}

XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static int ServiceApp_Deamon(int wait)
107107

108108
int main(int argc, char** argv)
109109
{
110-
#if (XENGINE_VERSION_KERNEL < 7) && (XENGINE_VERSION_MAIN < 19)
110+
#if (XENGINE_VERSION_KERNEL < 7) && (XENGINE_VERSION_MAIN < 21)
111111
printf("XEngine版本过低,无法继续\n");
112112
#endif
113113
#ifdef _WINDOWS

0 commit comments

Comments
 (0)