diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-07-11 01:29:12 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-07-11 01:29:12 +0900 |
| commit | 01f870221b2044ed14be828e02b00d4f6452d70d (patch) | |
| tree | 59c44b317e82275a8bdb07cdf60541dff837e512 | |
| parent | babdcb2c7d249b19ad38a07158e829f52a08e75a (diff) | |
Fix have entry removal
| -rw-r--r-- | src/HaveEraseCommand.cc | 2 | ||||
| -rw-r--r-- | src/TimerA2.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/HaveEraseCommand.cc b/src/HaveEraseCommand.cc index 51ef9a53..9c2b0bc0 100644 --- a/src/HaveEraseCommand.cc +++ b/src/HaveEraseCommand.cc @@ -61,7 +61,7 @@ void HaveEraseCommand::process() { // we are making a copy of current wallclock. auto expiry = global::wallclock(); - expiry.advance(5_s); + expiry.sub(5_s); const auto& groups = getDownloadEngine()->getRequestGroupMan()->getRequestGroups(); diff --git a/src/TimerA2.h b/src/TimerA2.h index 3140583f..2370dba3 100644 --- a/src/TimerA2.h +++ b/src/TimerA2.h @@ -82,6 +82,8 @@ public: template <typename duration> void advance(const duration& t) { tp_ += t; } + template <typename duration> void sub(const duration& t) { tp_ -= t; } + const Clock::time_point& getTime() const { return tp_; } static Timer zero() { return Timer(0_s); } |
