mirror of https://github.com/aria2/aria2
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced Time::reset() call with assigning of global::wallclock. * src/BtLeecherStateChoke.cc * src/BtSeederStateChoke.cc * src/PeerSessionResource.cc * src/RequestSlot.cc * src/ServerStat.cc * src/SpeedCalc.ccpull/1/head
parent
b1713e6373
commit
e3b5d60893
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Replaced Time::reset() call with assigning of global::wallclock.
|
||||||
|
* src/BtLeecherStateChoke.cc
|
||||||
|
* src/BtSeederStateChoke.cc
|
||||||
|
* src/PeerSessionResource.cc
|
||||||
|
* src/RequestSlot.cc
|
||||||
|
* src/ServerStat.cc
|
||||||
|
* src/SpeedCalc.cc
|
||||||
|
|
||||||
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Added changeUri XML-RPC method. This method removes/adds URIs
|
Added changeUri XML-RPC method. This method removes/adds URIs
|
||||||
|
|
|
@ -191,7 +191,7 @@ BtLeecherStateChoke::executeChoke
|
||||||
(const std::vector<SharedHandle<Peer> >& peerSet)
|
(const std::vector<SharedHandle<Peer> >& peerSet)
|
||||||
{
|
{
|
||||||
_logger->info("Leecher state, %d choke round started", _round);
|
_logger->info("Leecher state, %d choke round started", _round);
|
||||||
_lastRound.reset();
|
_lastRound = global::wallclock;
|
||||||
|
|
||||||
std::vector<PeerEntry> peerEntries;
|
std::vector<PeerEntry> peerEntries;
|
||||||
std::transform(peerSet.begin(), peerSet.end(),
|
std::transform(peerSet.begin(), peerSet.end(),
|
||||||
|
|
|
@ -139,7 +139,7 @@ BtSeederStateChoke::executeChoke
|
||||||
(const std::vector<SharedHandle<Peer> >& peerSet)
|
(const std::vector<SharedHandle<Peer> >& peerSet)
|
||||||
{
|
{
|
||||||
_logger->info("Seeder state, %d choke round started", _round);
|
_logger->info("Seeder state, %d choke round started", _round);
|
||||||
_lastRound.reset();
|
_lastRound = global::wallclock;
|
||||||
|
|
||||||
std::vector<PeerEntry> peerEntries;
|
std::vector<PeerEntry> peerEntries;
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "BitfieldMan.h"
|
#include "BitfieldMan.h"
|
||||||
#include "A2STR.h"
|
#include "A2STR.h"
|
||||||
#include "BtMessageDispatcher.h"
|
#include "BtMessageDispatcher.h"
|
||||||
|
#include "wallclock.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -68,7 +69,7 @@ void PeerSessionResource::amChoking(bool b)
|
||||||
{
|
{
|
||||||
_amChoking = b;
|
_amChoking = b;
|
||||||
if(!b) {
|
if(!b) {
|
||||||
_lastAmUnchoking.reset();
|
_lastAmUnchoking = global::wallclock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +253,7 @@ void PeerSessionResource::updateDownloadLength(size_t bytes)
|
||||||
{
|
{
|
||||||
_peerStat.updateDownloadLength(bytes);
|
_peerStat.updateDownloadLength(bytes);
|
||||||
|
|
||||||
_lastDownloadUpdate.reset();
|
_lastDownloadUpdate = global::wallclock;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t PeerSessionResource::getCompletedLength() const
|
uint64_t PeerSessionResource::getCompletedLength() const
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace aria2 {
|
||||||
RequestSlot RequestSlot::nullSlot = RequestSlot();
|
RequestSlot RequestSlot::nullSlot = RequestSlot();
|
||||||
|
|
||||||
void RequestSlot::setDispatchedTime() {
|
void RequestSlot::setDispatchedTime() {
|
||||||
dispatchedTime.reset();
|
dispatchedTime = global::wallclock;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RequestSlot::setDispatchedTime(time_t secFromEpoch) {
|
void RequestSlot::setDispatchedTime(time_t secFromEpoch) {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
#include "array_fun.h"
|
#include "array_fun.h"
|
||||||
#include "LogFactory.h"
|
#include "LogFactory.h"
|
||||||
|
#include "wallclock.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -77,7 +78,7 @@ void ServerStat::updateDownloadSpeed(unsigned int downloadSpeed)
|
||||||
if(downloadSpeed > 0) {
|
if(downloadSpeed > 0) {
|
||||||
_status = OK;
|
_status = OK;
|
||||||
}
|
}
|
||||||
_lastUpdated.reset();
|
_lastUpdated = global::wallclock;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerStat::setSingleConnectionAvgSpeed
|
void ServerStat::setSingleConnectionAvgSpeed
|
||||||
|
@ -184,7 +185,7 @@ void ServerStat::setStatusInternal(STATUS status)
|
||||||
_hostname.c_str(), _protocol.c_str());
|
_hostname.c_str(), _protocol.c_str());
|
||||||
}
|
}
|
||||||
_status = status;
|
_status = status;
|
||||||
_lastUpdated.reset();
|
_lastUpdated = global::wallclock;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerStat::setOK()
|
void ServerStat::setOK()
|
||||||
|
|
|
@ -51,11 +51,11 @@ SpeedCalc::SpeedCalc():sw(0), maxSpeed(0), prevSpeed(0), accumulatedLength(0),
|
||||||
|
|
||||||
void SpeedCalc::reset() {
|
void SpeedCalc::reset() {
|
||||||
std::fill(&lengthArray[0], &lengthArray[2], 0);
|
std::fill(&lengthArray[0], &lengthArray[2], 0);
|
||||||
std::for_each(&cpArray[0], &cpArray[2], std::mem_fun_ref(&Time::reset));
|
std::fill(&cpArray[0], &cpArray[2], global::wallclock);
|
||||||
sw = 0;
|
sw = 0;
|
||||||
maxSpeed = 0;
|
maxSpeed = 0;
|
||||||
prevSpeed = 0;
|
prevSpeed = 0;
|
||||||
start.reset();
|
start = global::wallclock;
|
||||||
accumulatedLength = 0;
|
accumulatedLength = 0;
|
||||||
nextInterval = CHANGE_INTERVAL_SEC;
|
nextInterval = CHANGE_INTERVAL_SEC;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ bool SpeedCalc::isIntervalOver(int64_t milliElapsed) const
|
||||||
|
|
||||||
void SpeedCalc::changeSw() {
|
void SpeedCalc::changeSw() {
|
||||||
lengthArray[sw] = 0;
|
lengthArray[sw] = 0;
|
||||||
cpArray[sw].reset();
|
cpArray[sw] = global::wallclock;
|
||||||
sw ^= 0x01;
|
sw ^= 0x01;
|
||||||
nextInterval = cpArray[sw].difference(global::wallclock)+CHANGE_INTERVAL_SEC;
|
nextInterval = cpArray[sw].difference(global::wallclock)+CHANGE_INTERVAL_SEC;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue