From 01f870221b2044ed14be828e02b00d4f6452d70d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 11 Jul 2016 01:29:12 +0900 Subject: [PATCH] Fix have entry removal --- src/HaveEraseCommand.cc | 2 +- src/TimerA2.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 void advance(const duration& t) { tp_ += t; } + template void sub(const duration& t) { tp_ -= t; } + const Clock::time_point& getTime() const { return tp_; } static Timer zero() { return Timer(0_s); }