Skip to content

Commit 207f99e

Browse files
committed
update
纠正了回复可用mirror总是为0.0.0.0的错误
1 parent fd3fb12 commit 207f99e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"files.associations": {
33
"center_head": "cpp",
4-
"common_head": "cpp"
4+
"common_head": "cpp",
5+
"mirror_head": "cpp"
56
}
67
}

Src/Center/Center.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ void center::wait_cli_login()
198198
//cookie为空或者没有找到时, 记录cli登录信息
199199
if(cached == false)
200200
{
201+
if(this->mirs_data_.size() == 0)
202+
memset(&available_mir, 0 sizeof(IP));
203+
else if(this->mirs_data_.size() == 1)
204+
available_mir = *mirs_data_.begin();
201205
//回复可用mir地址
202206
int send_num = sendto(sock_fd, &available_mir, sizeof(available_mir), 0, (sockaddr*)&addr_cli, sizeof(addr_cli));
203207
login_count++;
@@ -242,6 +246,7 @@ void center::wait_cli_login()
242246
}
243247
else //锁被pop队头或者查询任务使用中
244248
{
249+
LOG_INFO << "cached client login, no reply for client:" << uid;
245250
continue;
246251
}
247252
}

0 commit comments

Comments
 (0)