瀏覽代碼

Fix have entry removal

Tatsuhiro Tsujikawa 9 年之前
父節點
當前提交
01f870221b
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 1
      src/HaveEraseCommand.cc
  2. 2 0
      src/TimerA2.h

+ 1 - 1
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();

+ 2 - 0
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); }