diff options
Diffstat (limited to 'client/Config.cpp')
-rw-r--r-- | client/Config.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/client/Config.cpp b/client/Config.cpp index 40c24b2..38ff50f 100644 --- a/client/Config.cpp +++ b/client/Config.cpp @@ -73,20 +73,17 @@ void Config::FileEntry::Parse(string entry, ActionType _action) /* * ServerEntry nested class section */ -Config::ServerEntry::ServerEntry(string entry) -{ - ServerEntry(); - +Config::ServerEntry::ServerEntry(string& entry): host("127.0.0.1"), timeout(120), retryTimeout(60) +{ /* processing server entry e.g.: "8.8.8.8 600 60" */ size_t start = 0, end = 0; end = entry.find(' '); host = entry.substr(start, end); start = end+1; - end = entry.find(' '); + end = entry.find(' ', start); timeout = atoi(entry.substr(start, end).c_str()); start = end+1; - end = entry.find(' '); - retryTimeout = atoi(entry.substr(start, end).c_str()); + retryTimeout = atoi(entry.substr(start).c_str()); } |