Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions XEngine_Source/XEngine_StorageApp/StorageApp_UPLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,16 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in
SystemApi_File_CreateMutilFolder(tszTmpPath);
}
XHANDLE xhUPSpeed = NULL;
if (nLimit > 0 || (st_ServiceCfg.st_XLimit.bLimitMode && st_ServiceCfg.st_XLimit.nMaxUPLoader > 0))
int nEffectiveLimit = 0;
if (nLimit > 0)
{
nEffectiveLimit = nLimit;
}
else if (st_ServiceCfg.st_XLimit.bLimitMode && st_ServiceCfg.st_XLimit.nMaxUPLoader > 0)
{
nEffectiveLimit = (int)st_ServiceCfg.st_XLimit.nMaxUPLoader;
}
if (nEffectiveLimit > 0)
{
//处理限速情况
XCHAR* ptszIPClient = (XCHAR*)malloc(XPATH_MAX);
Expand All @@ -290,7 +299,7 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in
memset(ptszIPClient, '\0', XPATH_MAX);
_tcsxcpy(ptszIPClient, lpszClientAddr);

nLimit = nLimit == 0 ? (int)st_ServiceCfg.st_XLimit.nMaxUPLoader : nLimit;
nLimit = nEffectiveLimit;
xhUPSpeed = Algorithm_Calculation_Create();
Algorithm_Calculation_PassiveOPen(xhUPSpeed, XEngine_UPLoader_UPFlow, nLimit, 0, 0, false, ptszIPClient);
NetCore_TCPXCore_PasueRecvEx(xhNetUPLoader, lpszClientAddr, false);
Expand Down