diff options
Diffstat (limited to 'src/StreamFileAllocationEntry.cc')
| -rw-r--r-- | src/StreamFileAllocationEntry.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc index dfe1f679..de851da6 100644 --- a/src/StreamFileAllocationEntry.cc +++ b/src/StreamFileAllocationEntry.cc @@ -60,10 +60,13 @@ void StreamFileAllocationEntry::prepareForNextAction (std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e) { + auto &option = getRequestGroup()->getOption(); + // For DownloadContext::resetDownloadStartTime(), see also // RequestGroup::createInitialCommand() getRequestGroup()->getDownloadContext()->resetDownloadStartTime(); - if(getRequestGroup()->getOption()->getAsBool(PREF_ENABLE_MMAP)) { + if(option->getAsBool(PREF_ENABLE_MMAP) && + option->get(PREF_FILE_ALLOCATION) != V_NONE) { getRequestGroup()->getPieceStorage()->getDiskAdaptor()->enableMmap(); } if(getNextCommand()) { |
