diff options
Diffstat (limited to 'client/UpdatedConfig.cpp')
-rw-r--r-- | client/UpdatedConfig.cpp | 28 |
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 |