diff options
author | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-12-04 22:38:58 +0200 |
---|---|---|
committer | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-12-04 22:38:58 +0200 |
commit | 4fc3551822a57a3b26d0c4540e205f9b340f9899 (patch) | |
tree | 520054bf470b426c3f8a80a440bee83db89e721d /client/Config.cpp | |
parent | 34e4c314ed4934fbb3ace49e664430f6be44e578 (diff) |
FIX reconnection bug & server entry parser
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()); } |