2008-10-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed the bug in Time::elapsed(): Util::difftvsec() is used where
	Util::difftv() should be used instead.
	* src/TimeA2.cc
	* src/TimeA2.h
pull/1/head
Tatsuhiro Tsujikawa 2008-10-05 14:03:08 +00:00
parent 389f770008
commit 4305a51dd0
3 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2008-10-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug in Time::elapsed(): Util::difftvsec() is used where
Util::difftv() should be used instead.
* src/TimeA2.cc
* src/TimeA2.h
2008-10-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made socket for dht connections non-blocking

View File

@ -34,9 +34,11 @@
/* copyright --> */
#include "TimeA2.h"
#include <cstring>
#include "Util.h"
#include "array_fun.h"
#include <cstring>
namespace aria2 {
@ -90,7 +92,8 @@ bool Time::elapsed(time_t sec) const {
if(tv.tv_sec+sec < now) {
return true;
} else if(tv.tv_sec+sec == now) {
return Util::difftvsec(getCurrentTime(), tv) >= sec;
return
Util::difftv(getCurrentTime(), tv) >= static_cast<int64_t>(sec)*1000000;
} else {
return false;
}

View File

@ -36,10 +36,13 @@
#define _D_TIME_H_
#include "common.h"
#include "a2time.h"
#include <stdint.h>
#include <string>
#include "a2time.h"
namespace aria2 {
class Time {