mirror of https://github.com/aria2/aria2
2008-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed _uploadLength and _downloadLength from PeerSessionResource and use PeerStat::_sessionUploadLength and PeerStat::_sessionDownloadLength. * src/PeerSessionResource.cc * src/PeerSessionResource.hpull/1/head
parent
c1ba5c9745
commit
cdaafd8c8c
|
@ -1,3 +1,11 @@
|
||||||
|
2008-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Removed _uploadLength and _downloadLength from PeerSessionResource
|
||||||
|
and use PeerStat::_sessionUploadLength and
|
||||||
|
PeerStat::_sessionDownloadLength.
|
||||||
|
* src/PeerSessionResource.cc
|
||||||
|
* src/PeerSessionResource.h
|
||||||
|
|
||||||
2008-09-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-09-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Fixed the bug that prefixLength of split bucket which doesn't include
|
Fixed the bug that prefixLength of split bucket which doesn't include
|
||||||
|
|
|
@ -53,8 +53,6 @@ PeerSessionResource::PeerSessionResource(size_t pieceLength, uint64_t totalLengt
|
||||||
_extendedMessagingEnabled(false),
|
_extendedMessagingEnabled(false),
|
||||||
_dhtEnabled(false),
|
_dhtEnabled(false),
|
||||||
_latency(DEFAULT_LATENCY),
|
_latency(DEFAULT_LATENCY),
|
||||||
_uploadLength(0),
|
|
||||||
_downloadLength(0),
|
|
||||||
_lastDownloadUpdate(0),
|
_lastDownloadUpdate(0),
|
||||||
_lastAmUnchoking(0)
|
_lastAmUnchoking(0)
|
||||||
{}
|
{}
|
||||||
|
@ -305,24 +303,22 @@ void PeerSessionResource::updateLatency(unsigned int latency)
|
||||||
|
|
||||||
uint64_t PeerSessionResource::uploadLength() const
|
uint64_t PeerSessionResource::uploadLength() const
|
||||||
{
|
{
|
||||||
return _uploadLength;
|
return _peerStat.getSessionUploadLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerSessionResource::updateUploadLength(size_t bytes)
|
void PeerSessionResource::updateUploadLength(size_t bytes)
|
||||||
{
|
{
|
||||||
_peerStat.updateUploadLength(bytes);
|
_peerStat.updateUploadLength(bytes);
|
||||||
_uploadLength += bytes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t PeerSessionResource::downloadLength() const
|
uint64_t PeerSessionResource::downloadLength() const
|
||||||
{
|
{
|
||||||
return _downloadLength;
|
return _peerStat.getSessionDownloadLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerSessionResource::updateDownloadLength(size_t bytes)
|
void PeerSessionResource::updateDownloadLength(size_t bytes)
|
||||||
{
|
{
|
||||||
_peerStat.updateDownloadLength(bytes);
|
_peerStat.updateDownloadLength(bytes);
|
||||||
_downloadLength += bytes;
|
|
||||||
|
|
||||||
_lastDownloadUpdate.reset();
|
_lastDownloadUpdate.reset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,6 @@ private:
|
||||||
bool _dhtEnabled;
|
bool _dhtEnabled;
|
||||||
PeerStat _peerStat;
|
PeerStat _peerStat;
|
||||||
unsigned int _latency;
|
unsigned int _latency;
|
||||||
uint64_t _uploadLength;
|
|
||||||
uint64_t _downloadLength;
|
|
||||||
|
|
||||||
Time _lastDownloadUpdate;
|
Time _lastDownloadUpdate;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue