Changeset - dc478a0cfa37
[Not reviewed]
0 2 0
Jan Kaluza - 13 years ago 2012-07-30 10:05:35
hanzz.k@gmail.com
Replace in portfile option
2 files changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
spectrum/src/sample.cfg
Show inline comments
 
@@ -20,6 +20,7 @@ protocol=prpl-msn
 
#protocol=any
 
#protocol=prpl-icq
 
working_dir=./
 
portfile=$jid.port
 

	
 
[backend]
 
#default_avatar=catmelonhead.jpg
src/config.cpp
Show inline comments
 
@@ -134,6 +134,7 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description
 

	
 
	bool found_working = false;
 
	bool found_pidfile = false;
 
	bool found_portfile = false;
 
	bool found_backend_port = false;
 
	bool found_database = false;
 
	std::string jid = "";
 
@@ -159,6 +160,9 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description
 
		else if (opt.string_key == "service.pidfile") {
 
			found_pidfile = true;
 
		}
 
		else if (opt.string_key == "service.portfile") {
 
			found_portfile = true;
 
		}
 
		else if (opt.string_key == "database.database") {
 
			found_database = true;
 
		}
 
@@ -174,6 +178,11 @@ bool Config::load(std::istream &ifs, boost::program_options::options_description
 
		value.push_back("/var/run/spectrum2/$jid.pid");
 
		parsed.options.push_back(boost::program_options::basic_option<char>("service.pidfile", value));
 
	}
 
	if (!found_portfile) {
 
		std::vector<std::string> value;
 
		value.push_back("/var/run/spectrum2/$jid.port");
 
		parsed.options.push_back(boost::program_options::basic_option<char>("service.portfile", value));
 
	}
 
	if (!found_backend_port) {
 
		std::vector<std::string> value;
 
		std::string p = boost::lexical_cast<std::string>(getRandomPort(_jid.empty() ? jid : _jid));
0 comments (0 inline, 0 general)