Skip to content

Commit 615c96c

Browse files
committed
delete:center Distributed function,it is useless
1 parent df3b67f commit 615c96c

File tree

4 files changed

+3
-40
lines changed

4 files changed

+3
-40
lines changed

XEngine_Source/StorageModule_Config/Config_Define.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,18 @@ typedef struct
127127
bool bDistributed;
128128
struct
129129
{
130-
int nCenterMode;
131130
int nUPLoadMode;
132131
int nDownldMode;
133132
int nStorageMode;
134133
}st_LBDistributed;
135134
struct
136135
{
137-
int nCenterMode;
138136
int nUPLoadMode;
139137
int nDownldMode;
140138
int nStorageMode;
141139
}st_LBLocation;
142140
struct
143141
{
144-
list<string>* pStl_ListCenter;
145142
list<string>* pStl_ListDownload;
146143
list<string>* pStl_ListUPLoader;
147144
list<XENGINE_STORAGEBUCKET>* pStl_ListBucket;

XEngine_Source/StorageModule_Config/Config_Json/Config_Json.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -296,44 +296,36 @@ bool CConfig_Json::Config_Json_LoadBalance(LPCXSTR lpszConfigFile, XENGINE_LBCON
296296
}
297297
pSt_ServerConfig->bDistributed = st_JsonRoot["bDistributed"].asInt();
298298

299-
if (st_JsonRoot["LBDistributed"].empty() || (4 != st_JsonRoot["LBDistributed"].size()))
299+
if (st_JsonRoot["LBDistributed"].empty() || (3 != st_JsonRoot["LBDistributed"].size()))
300300
{
301301
Config_IsErrorOccur = true;
302302
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBDISTRIBUTED;
303303
return false;
304304
}
305305
Json::Value st_JsonLBDistributed = st_JsonRoot["LBDistributed"];
306-
pSt_ServerConfig->st_LBDistributed.nCenterMode = st_JsonLBDistributed["nCenterMode"].asInt();
307306
pSt_ServerConfig->st_LBDistributed.nUPLoadMode = st_JsonLBDistributed["nUPLoadMode"].asInt();
308307
pSt_ServerConfig->st_LBDistributed.nDownldMode = st_JsonLBDistributed["nDownldMode"].asInt();
309308
pSt_ServerConfig->st_LBDistributed.nStorageMode = st_JsonLBDistributed["nStorageMode"].asInt();
310309

311-
if (st_JsonRoot["LBLocation"].empty() || (4 != st_JsonRoot["LBLocation"].size()))
310+
if (st_JsonRoot["LBLocation"].empty() || (3 != st_JsonRoot["LBLocation"].size()))
312311
{
313312
Config_IsErrorOccur = true;
314313
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_LBLOCATION;
315314
return false;
316315
}
317316
Json::Value st_JsonLBLocation = st_JsonRoot["LBLocation"];
318-
pSt_ServerConfig->st_LBLocation.nCenterMode = st_JsonLBLocation["nCenterMode"].asInt();
319317
pSt_ServerConfig->st_LBLocation.nUPLoadMode = st_JsonLBLocation["nUPLoadMode"].asInt();
320318
pSt_ServerConfig->st_LBLocation.nDownldMode = st_JsonLBLocation["nDownldMode"].asInt();
321319
pSt_ServerConfig->st_LBLocation.nStorageMode = st_JsonLBLocation["nStorageMode"].asInt();
322320

323-
if (st_JsonRoot["LoadBalance"].empty() || (4 != st_JsonRoot["LoadBalance"].size()))
321+
if (st_JsonRoot["LoadBalance"].empty() || (3 != st_JsonRoot["LoadBalance"].size()))
324322
{
325323
Config_IsErrorOccur = true;
326324
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_LAODBALANCE;
327325
return false;
328326
}
329327
Json::Value st_JsonLoadBalance = st_JsonRoot["LoadBalance"];
330328

331-
pSt_ServerConfig->st_LoadBalance.pStl_ListCenter = new list<string>;
332-
for (unsigned int i = 0; i < st_JsonLoadBalance["CenterAddr"].size(); i++)
333-
{
334-
pSt_ServerConfig->st_LoadBalance.pStl_ListCenter->push_back(st_JsonLoadBalance["CenterAddr"][i].asCString());
335-
}
336-
337329
pSt_ServerConfig->st_LoadBalance.pStl_ListDownload = new list<string>;
338330
for (unsigned int i = 0; i < st_JsonLoadBalance["DownloadAddr"].size(); i++)
339331
{

XEngine_Source/XEngine_StorageApp/StorageApp_Center.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,27 +116,6 @@ bool XEngine_Task_HttpCenter(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int
116116

117117
if (0 == _tcsxnicmp(lpszMethodPost, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodPost)))
118118
{
119-
//使用重定向?
120-
if (st_LoadbalanceCfg.st_LBDistributed.nCenterMode > 0)
121-
{
122-
XCHAR tszHdrBuffer[1024];
123-
XCHAR tszStorageAddr[128];
124-
125-
memset(tszHdrBuffer, '\0', sizeof(tszHdrBuffer));
126-
memset(tszStorageAddr, '\0', sizeof(tszStorageAddr));
127-
128-
st_HDRParam.bIsClose = true;
129-
st_HDRParam.nHttpCode = 302;
130-
131-
APIHelp_Distributed_RandomAddr(st_LoadbalanceCfg.st_LoadBalance.pStl_ListCenter, tszStorageAddr, st_LoadbalanceCfg.st_LBDistributed.nCenterMode);
132-
_xstprintf(tszHdrBuffer, _X("Location: %s%s\r\n"), tszStorageAddr, pSt_HTTPParam->tszHttpUri);
133-
134-
HttpProtocol_Server_SendMsgEx(xhDLHttp, tszSDBuffer, &nSDLen, &st_HDRParam, NULL, 0, tszHdrBuffer);
135-
XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPUPLOADER);
136-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("业务客户端:%s,请求的函数被要求重定向到:%s%s"), lpszClientAddr, tszStorageAddr, pSt_HTTPParam->tszHttpUri);
137-
return true;
138-
}
139-
140119
if (!HttpProtocol_ServerHelp_GetUrlApi(pSt_HTTPParam->tszHttpUri, tszAPIVersion, tszAPIMethod, tszAPIName))
141120
{
142121
st_HDRParam.bIsClose = true;

XEngine_Source/XEngine_StorageApp/StorageApp_Config.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ bool StorageApp_Config_Parament(int argc,char **argv)
1515
delete st_LoadbalanceCfg.st_LoadBalance.pStl_ListBucket;
1616
st_LoadbalanceCfg.st_LoadBalance.pStl_ListBucket = NULL;
1717
}
18-
if (NULL != st_LoadbalanceCfg.st_LoadBalance.pStl_ListCenter)
19-
{
20-
delete st_LoadbalanceCfg.st_LoadBalance.pStl_ListCenter;
21-
st_LoadbalanceCfg.st_LoadBalance.pStl_ListCenter = NULL;
22-
}
2318
if (NULL != st_LoadbalanceCfg.st_LoadBalance.pStl_ListDownload)
2419
{
2520
delete st_LoadbalanceCfg.st_LoadBalance.pStl_ListDownload;

0 commit comments

Comments
 (0)