Fixed bug.
This commit is contained in:
@@ -68,7 +68,7 @@ namespace Apostol {
|
||||
|
||||
if (m_Servers.Count() == 0) {
|
||||
#ifdef _DEBUG
|
||||
const int index = m_Servers.AddPair(BPS_BM_DEBUG_ADDRESS, CClientContext(BPS_BM_DEBUG_ADDRESS, CLocation(BPS_DEBUG_SERVER_URL)));
|
||||
const int index = m_Servers.AddPair(BPS_DEBUG_SERVER_URL, CClientContext(BPS_BM_DEBUG_ADDRESS, CLocation(BPS_DEBUG_SERVER_URL)));
|
||||
auto &Keys = m_Servers[index].Value().PGP();
|
||||
Keys.Add(CKeyContext(CString("PUBLIC"), CString()));
|
||||
Keys.Add(CKeyContext(CString(BPS_BM_DEBUG_ADDRESS), CString()));
|
||||
@@ -139,7 +139,7 @@ namespace Apostol {
|
||||
|
||||
CWebSocketClient *CWebSocketModule::GetConnectedClient(const CClientContext &Context) {
|
||||
for (int i = 0; i < Context.ClientManager().Count(); i++) {
|
||||
auto pClient = Context.ClientManager()[i];
|
||||
const auto pClient = Context.ClientManager()[i];
|
||||
if (pClient->Connected())
|
||||
return pClient;
|
||||
}
|
||||
@@ -154,8 +154,8 @@ namespace Apostol {
|
||||
while (index < m_Servers.Count()) {
|
||||
const auto &caContext = m_Servers[index].Value();
|
||||
if (caContext.Status() == Context::csRunning) {
|
||||
if (Params.IsEmpty() || Params == caContext.URL().Origin()) {
|
||||
auto pClient = GetConnectedClient(caContext);
|
||||
if (Params.IsEmpty() || Params == caContext.Name() || Params == caContext.URL().Origin()) {
|
||||
const auto pClient = GetConnectedClient(caContext);
|
||||
if (pClient != nullptr)
|
||||
return index;
|
||||
}
|
||||
@@ -1111,10 +1111,7 @@ namespace Apostol {
|
||||
void CWebSocketModule::Heartbeat(CDateTime Now) {
|
||||
for (int i = 0; i < m_Servers.Count(); i++) {
|
||||
auto &Context = m_Servers[i].Value();
|
||||
#ifndef _DEBUG
|
||||
if (Context.Name() == BPS_BM_DEBUG_ADDRESS)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (Now >= Context.CheckDate()) {
|
||||
Context.SetCheckDate(Now + (CDateTime) 30 / SecsPerDay); // 30 sec
|
||||
|
||||
@@ -1136,7 +1133,7 @@ namespace Apostol {
|
||||
|
||||
if (Context.Status() == Context::csRunning) {
|
||||
for (int j = 0; j < Context.ClientManager().Count(); ++j) {
|
||||
auto pClient = Context.ClientManager()[j];
|
||||
const auto pClient = Context.ClientManager()[j];
|
||||
|
||||
if (!pClient->Active())
|
||||
pClient->Active(true);
|
||||
|
||||
Reference in New Issue
Block a user