From a55a225899dbd47dd4238adf3a49f62846cb87f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 14 Dec 2015 06:48:14 +0100 Subject: Imported Upstream version 1.0.0 --- src/bitz/config.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/bitz/config.cpp') diff --git a/src/bitz/config.cpp b/src/bitz/config.cpp index a9ca856..aaa247f 100644 --- a/src/bitz/config.cpp +++ b/src/bitz/config.cpp @@ -39,6 +39,7 @@ namespace bitz { _config.max_workers = 0; _config.max_worker_requests = 0; + _config.comm_timeout = 0; // defaults _lconfig = NULL; @@ -70,11 +71,11 @@ namespace bitz { try { config->readFile( config_file.c_str() ); - } catch( const libconfig::FileIOException &ex ) { + } catch ( const libconfig::FileIOException &ex ) { std::cerr << "[config] failed to read config file: " << config_file << ", exception: " << ex.what() << std::endl; exit( EXIT_FAILURE ); - } catch( const libconfig::ParseException &pex ) { + } catch ( const libconfig::ParseException &pex ) { std::cerr << "[config] parse error at " << pex.getFile() << ":" << pex.getLine() << " - " << pex.getError() << std::endl; exit( EXIT_FAILURE ); @@ -91,7 +92,9 @@ namespace bitz { config->lookupValue( "max_workers", _config.max_workers ); config->lookupValue( "max_worker_requests", _config.max_worker_requests ); - } catch( const libconfig::SettingNotFoundException &e ) { + config->lookupValue( "comm_timeout", _config.comm_timeout ); + + } catch ( const libconfig::SettingNotFoundException &e ) { std::cerr << "[config] failed to load core configs, " << e.getPath() << " : " << e.what() << std::endl; } @@ -121,7 +124,7 @@ namespace bitz { try { libconfig::Setting &setting = _lconfig->lookup( std::string( "modules." ).append( module ) ); setting.lookupValue( config, config_value ); - } catch( const libconfig::SettingNotFoundException &e ) { + } catch ( const libconfig::SettingNotFoundException &e ) { // TODO: log errors ?? std::cerr << "[config] " << e.getPath() << " : " << e.what() << std::endl; } -- cgit v1.2.3