From 6f9a82364b5480ac7b0056b3563776bacf605f62 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 5 Nov 2011 02:13:28 +0200 Subject: Server config requests. ALERT: segfault at runtime! Not fixed yet --- client/Config.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'client/Config.h') diff --git a/client/Config.h b/client/Config.h index c95d9c6..11bed90 100644 --- a/client/Config.h +++ b/client/Config.h @@ -4,13 +4,15 @@ #define CONFIG_H #include +#include #include "Proxy.h" +#include using std::vector; using std::string; -class ProxyEntryGeneric; -class ProxyEntryStatic; +class SslClient; +class QTimer; /** * @brief Singleton class that represents client configuration
@@ -19,8 +21,9 @@ class ProxyEntryStatic; * Then retries is made to connect to server and acqire actual config, * firewall list, etc. */ -class Config +class Config: public QObject { + Q_OBJECT public: /** * @brief Class to represent 'firewall' record in the config file @@ -207,11 +210,21 @@ private: * @brief Pointer to the singleton Config instance */ static Config *self; - + /** * @brief time interval between consequtive config updates */ unsigned updateInterval; + + /** + * @brief SslCLient instance that connects to server and retrieves config + */ + SslClient *client; + + /** + * @brief timer that is responsible on config updates + */ + QTimer *configUpdateTimer; bool configValid; vector genericProxy; vector staticProxy; @@ -219,6 +232,9 @@ private: vector servers; int ReadGenericProxy(); int ReadStaticProxy(); +private slots: + void updateConfig(); + void gotServerReply(SslClient::RequestType &type, QByteArray &confdata); }; -- cgit v1.2.3