mirror of
https://github.com/aria2/aria2.git
synced 2026-04-11 23:39:05 +00:00
2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Limited the number files opened in each BitTorrent download. The default value is 100. The option to change this value will be added. * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/MultiFileAllocationIterator.cc
This commit is contained in:
@@ -59,8 +59,12 @@ void MultiFileAllocationIterator::allocateChunk()
|
||||
DiskWriterEntryHandle entry = _entries.front();
|
||||
_entries.pop_front();
|
||||
FileEntryHandle fileEntry = entry->getFileEntry();
|
||||
// Open file before calling DiskWriterEntry::size()
|
||||
_diskAdaptor->openIfNot(entry, &DiskWriterEntry::openFile,
|
||||
_diskAdaptor->getTopDirPath());
|
||||
entry->enableDirectIO();
|
||||
if(entry->size() < fileEntry->getLength()) {
|
||||
entry->getDiskWriter()->enableDirectIO();
|
||||
// Calling private function of MultiDiskAdaptor.
|
||||
_fileAllocationIterator.reset
|
||||
(new SingleFileAllocationIterator(entry->getDiskWriter().get(),
|
||||
entry->size(),
|
||||
|
||||
Reference in New Issue
Block a user