diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2014-06-04 21:45:12 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2014-06-04 21:45:12 +0900 |
| commit | 4f3c526dcdf5fce74dd12be1c882f6c47d1829ec (patch) | |
| tree | 9e67f3032b6de4be1cf915fd86b439eea6521314 /src/HttpResponseCommand.cc | |
| parent | adeead6f0396e2f8551d1182972e277728fd6c8b (diff) | |
Support PREF_DIR change for Metalink files
Reworked previous commit adeead6f0396e2f8551d1182972e277728fd6c8b, and
now support changing PREF_DIR for Metalink downloads.
Diffstat (limited to 'src/HttpResponseCommand.cc')
| -rw-r--r-- | src/HttpResponseCommand.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 34ae1cc8..9e9477ab 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -249,8 +249,11 @@ bool HttpResponseCommand::executeInternal() int64_t totalLength = httpResponse->getEntityLength(); fe->setLength(totalLength); if (fe->getPath().empty()) { - fe->setPath(util::createSafePath(getOption()->get(PREF_DIR), - httpResponse->determineFilename())); + auto suffixPath = + util::createSafePath(httpResponse->determineFilename()); + + fe->setPath(util::applyDir(getOption()->get(PREF_DIR), suffixPath)); + fe->setSuffixPath(suffixPath); } fe->setContentType(httpResponse->getContentType()); grp->preDownloadProcessing(); |
