mirror of https://github.com/aria2/aria2
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.hpull/1/head
parent
389f770008
commit
4305a51dd0
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue