summaryrefslogtreecommitdiff
path: root/client/UpdatedConfig.cpp
diff options
context:
space:
mode:
authorAlex Borisov <borisov.alexandr@rambler.ru>2011-11-17 00:06:16 +0200
committerAlex Borisov <borisov.alexandr@rambler.ru>2011-11-17 00:06:16 +0200
commitb068f321dd9c6077c590473c4f108be87e7eb99d (patch)
treea24853f71981773b2a3051c2a32beea5c9c7dc59 /client/UpdatedConfig.cpp
parent5861309ceb8474cf0cdb4d29b2e3a0e76518a9aa (diff)
Return to server config w permanent connection. Update message
Diffstat (limited to 'client/UpdatedConfig.cpp')
-rw-r--r--client/UpdatedConfig.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/client/UpdatedConfig.cpp b/client/UpdatedConfig.cpp
index a08d417..1bae8a2 100644
--- a/client/UpdatedConfig.cpp
+++ b/client/UpdatedConfig.cpp
@@ -54,20 +54,19 @@ void UpdatedConfig::update()
retryFailed = false;
}
- /*if (! (updateStatus & SslClient::Config))
+ if (! (updateStatus & (1 << SslClient::Config)))
{
client->SendRequest(SslClient::Config);
}
- else*/
- if (! (updateStatus & SslClient::GenericProxyList))
+ if (! (updateStatus & (1 << SslClient::GenericProxyList)))
{
client->SendRequest(SslClient::GenericProxyList);
}
- else if (! (updateStatus & SslClient::StaticProxyList))
+ else if (! (updateStatus & (1 << SslClient::StaticProxyList)))
{
client->SendRequest(SslClient::StaticProxyList);
}
- else if (! (updateStatus & SslClient::FirewallList))
+ else if (! (updateStatus & (1 << SslClient::FirewallList)))
{
client->SendRequest(SslClient::FirewallList);
}
@@ -99,6 +98,8 @@ void UpdatedConfig::gotServerReply(SslClient::RequestType &type, QByteArray &con
goto end;
}
+ //Logger::Debug("data: %s\n", confdata.constData());
+
/* stop timer - working server found */
configUpdateTimer->stop();
@@ -106,19 +107,19 @@ void UpdatedConfig::gotServerReply(SslClient::RequestType &type, QByteArray &con
{
case SslClient::Config:
ParseConfig(confdata.constData());
- updateStatus |= type;
+ updateStatus |= (1 << type);
break;
case SslClient::GenericProxyList:
ParseGenericProxies(confdata.constData());
- updateStatus |= type;
+ updateStatus |= (1 << type);
break;
case SslClient::StaticProxyList:
ParseStaticPorxies(confdata.constData());
- updateStatus |= type;
+ updateStatus |= (1 << type);
break;
case SslClient::FirewallList:
ParseFirewalls(confdata.constData());
- updateStatus |= type;
+ updateStatus |= (1 << type);
break;
default:
Logger::Warn("Unknown reply type: %x\n", type);
@@ -126,9 +127,14 @@ void UpdatedConfig::gotServerReply(SslClient::RequestType &type, QByteArray &con
}
end:
- if ((updateStatus & 0x0F) != 0x0F)
+ if (updateStatus != 0x1E)
{
- Logger::Trace("Still need to update other config parts\n");
+ Logger::Trace("Still need to update other config parts. Update status: %x\n", updateStatus);
update();
}
+ else
+ {
+ Logger::Info("Config successfully updated!\n");
+ emit updated();
+ }
} \ No newline at end of file