mirror of https://github.com/aria2/aria2
2010-07-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that DownloadContext::resetDownloadStartTime() never be called in downloads whose total length is unknown. This causes avg speed in Download Results is always 0 for these downloads. * src/RequestGroup.cc * src/BtFileAllocationEntry.cc * src/StreamFileAllocationEntry.ccpull/1/head
parent
53c4de7ffd
commit
8d2ca8e03c
|
@ -1,3 +1,12 @@
|
||||||
|
2010-07-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Fixed the bug that DownloadContext::resetDownloadStartTime() never
|
||||||
|
be called in downloads whose total length is unknown. This causes
|
||||||
|
avg speed in Download Results is always 0 for these downloads.
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
* src/BtFileAllocationEntry.cc
|
||||||
|
* src/StreamFileAllocationEntry.cc
|
||||||
|
|
||||||
2010-07-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-07-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Fixed the bug that AdaptiveFileAllocationIterator::finished()
|
Fixed the bug that AdaptiveFileAllocationIterator::finished()
|
||||||
|
|
|
@ -58,6 +58,8 @@ void BtFileAllocationEntry::prepareForNextAction
|
||||||
BtSetup().setup(commands, getRequestGroup(), e,
|
BtSetup().setup(commands, getRequestGroup(), e,
|
||||||
getRequestGroup()->getOption().get());
|
getRequestGroup()->getOption().get());
|
||||||
if(!getRequestGroup()->downloadFinished()) {
|
if(!getRequestGroup()->downloadFinished()) {
|
||||||
|
// For DownloadContext::resetDownloadStartTime(), see also
|
||||||
|
// RequestGroup::createInitialCommand()
|
||||||
getRequestGroup()->getDownloadContext()->resetDownloadStartTime();
|
getRequestGroup()->getDownloadContext()->resetDownloadStartTime();
|
||||||
const std::vector<SharedHandle<FileEntry> >& fileEntries =
|
const std::vector<SharedHandle<FileEntry> >& fileEntries =
|
||||||
getRequestGroup()->getDownloadContext()->getFileEntries();
|
getRequestGroup()->getDownloadContext()->getFileEntries();
|
||||||
|
|
|
@ -200,6 +200,11 @@ void RequestGroup::closeFile()
|
||||||
void RequestGroup::createInitialCommand
|
void RequestGroup::createInitialCommand
|
||||||
(std::vector<Command*>& commands, DownloadEngine* e)
|
(std::vector<Command*>& commands, DownloadEngine* e)
|
||||||
{
|
{
|
||||||
|
// Start session timer here. When file size becomes known, it will
|
||||||
|
// be reset again in *FileAllocationEntry, because hash check and
|
||||||
|
// file allocation takes a time. For downloads in which file size
|
||||||
|
// is unknown, session timer will not be reset.
|
||||||
|
downloadContext_->resetDownloadStartTime();
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
{
|
{
|
||||||
if(downloadContext_->hasAttribute(bittorrent::BITTORRENT)) {
|
if(downloadContext_->hasAttribute(bittorrent::BITTORRENT)) {
|
||||||
|
|
|
@ -59,6 +59,8 @@ void StreamFileAllocationEntry::prepareForNextAction
|
||||||
(std::vector<Command*>& commands,
|
(std::vector<Command*>& commands,
|
||||||
DownloadEngine* e)
|
DownloadEngine* e)
|
||||||
{
|
{
|
||||||
|
// For DownloadContext::resetDownloadStartTime(), see also
|
||||||
|
// RequestGroup::createInitialCommand()
|
||||||
getRequestGroup()->getDownloadContext()->resetDownloadStartTime();
|
getRequestGroup()->getDownloadContext()->resetDownloadStartTime();
|
||||||
if(getNextCommand()) {
|
if(getNextCommand()) {
|
||||||
// give _nextCommand a chance to execute in the next execution loop.
|
// give _nextCommand a chance to execute in the next execution loop.
|
||||||
|
|
Loading…
Reference in New Issue