- FILE * file = fopen(fname, "rt");
- if (!file) {
- fprintf(stderr, "Error: Cannot load configuration file: %s!\n",
- fname);
- exit(3);
- }
- /* File exists, so file has been locked. Release it. */
-
- config_init(&cfg);
-
- /* Read the file. If there is an error, report it and exit. */
- if (!config_read(&cfg, file)) {
- fprintf(stderr, "%s! In file %s, line %d\n",
- config_error_text(&cfg),
- config_error_file(&cfg),
- config_error_line(&cfg));
- config_destroy(&cfg);
- fclose(file);
- exit(3);
- }
-
- setting = config_lookup(&cfg, "node_number");
- if (setting) {
- NodeNumber = config_setting_get_int(setting);
- } else {
- fprintf(stderr, "%s! In file %s, '%s' was not found.\n",
- "Warning", fname, "node_number");
- config_destroy(&cfg);
- fclose(file);
- exit(3);
- }
-
- setting = config_lookup(&cfg, "type");
- if (setting) {
- /* same as strcmp(..) == 0 */
- if (!strcmp(config_setting_get_string(setting), "explicit")) {
- ConType = 1;
- } else {
- ConType = 2;
+ std::vector<std::string> hosts = config.getHosts();
+ for (unsigned int i = 0; i < hosts.size(); i++) {
+ ConnectList.append(new ConnectEntry(hosts[i].c_str()));