From 0da554ba6a55bbc195a30afa8f154af2ec2107a7 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 30 Jul 2008 12:19:03 +0000 Subject: Reenabled the config file parser. --- server/src/pracrod.cc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'server/src/pracrod.cc') diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc index c668159..6ee1817 100644 --- a/server/src/pracrod.cc +++ b/server/src/pracrod.cc @@ -52,6 +52,7 @@ // For getopt_long and friends #include +#include "configurationparser.h" #include "configuration.h" #include "server.h" @@ -82,19 +83,19 @@ static const char usage_str[] = " -h, --help Print this message and exit.\n" ; +ConfigurationParser *configparser = NULL; + void reload(int) { - /* int port; printf("Reload!\n"); - port = config()->lookup("port"); - config()->reload(); + port = configparser->lookup("port"); + configparser->reload(); { // Force wake the server process for reinitialization. TCPSocket socket; socket.connect("localhost", port); } - */ } class PracroDaemon : public Daemon { @@ -170,15 +171,8 @@ int main(int argc, char *argv[]) } // Load config - /* - char defval[512]; - sprintf(defval, ETC"/pracrod.conf"); - char *cfname = NULL; - if(!configfile) cfname = defval;//ETC"/pracrod.conf"; - else cfname = configfile; - Configuration conf(cfname); - initConfig(&conf); - */ + if(configfile) configparser = new ConfigurationParser(configfile); + else configparser = new ConfigurationParser(ETC"/pracrod.conf"); if(!user) { user = strdup(Conf::server_user.c_str()); -- cgit v1.2.3