summaryrefslogtreecommitdiff
path: root/src/ServerStatMan.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-11-03 18:51:31 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-11-03 18:51:31 +0900
commit9bb914b76e61dfed6044afee529eb92344bbca7a (patch)
tree016f9b4f6cdd1449398d05d6ce469b07463fa28c /src/ServerStatMan.cc
parent6ef91d60b34a2a93b397b6db4daabfe8017d31fb (diff)
Changed parse*Int functions so that it accepts iterators.
Diffstat (limited to 'src/ServerStatMan.cc')
-rw-r--r--src/ServerStatMan.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ServerStatMan.cc b/src/ServerStatMan.cc
index 3804c901..41591ca5 100644
--- a/src/ServerStatMan.cc
+++ b/src/ServerStatMan.cc
@@ -171,20 +171,26 @@ bool ServerStatMan::load(const std::string& filename)
}
SharedHandle<ServerStat> sstat(new ServerStat(m[S_HOST], m[S_PROTOCOL]));
try {
- sstat->setDownloadSpeed(util::parseUInt(m[S_DL_SPEED]));
+ const std::string& dlSpeed = m[S_DL_SPEED];
+ sstat->setDownloadSpeed(util::parseUInt(dlSpeed.begin(), dlSpeed.end()));
// Old serverstat file doesn't contains SC_AVG_SPEED
if(m.find(S_SC_AVG_SPEED) != m.end()) {
- sstat->setSingleConnectionAvgSpeed(util::parseUInt(m[S_SC_AVG_SPEED]));
+ const std::string& s = m[S_SC_AVG_SPEED];
+ sstat->setSingleConnectionAvgSpeed(util::parseUInt(s.begin(), s.end()));
}
// Old serverstat file doesn't contains MC_AVG_SPEED
if(m.find(S_MC_AVG_SPEED) != m.end()) {
- sstat->setMultiConnectionAvgSpeed(util::parseUInt(m[S_MC_AVG_SPEED]));
+ const std::string& s = m[S_MC_AVG_SPEED];
+ sstat->setMultiConnectionAvgSpeed(util::parseUInt(s.begin(), s.end()));
}
// Old serverstat file doesn't contains COUNTER_SPEED
if(m.find(S_COUNTER) != m.end()) {
- sstat->setCounter(util::parseUInt(m[S_COUNTER]));
+ const std::string& s = m[S_COUNTER];
+ sstat->setCounter(util::parseUInt(s.begin(), s.end()));
}
- sstat->setLastUpdated(Time(util::parseInt(m[S_LAST_UPDATED])));
+ const std::string& lastUpdated = m[S_LAST_UPDATED];
+ sstat->setLastUpdated
+ (Time(util::parseInt(lastUpdated.begin(), lastUpdated.end())));
sstat->setStatus(m[S_STATUS]);
add(sstat);
} catch(RecoverableException& e) {