summaryrefslogtreecommitdiff
path: root/src/HttpResponseCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-06-04 21:45:12 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-06-04 21:45:12 +0900
commit4f3c526dcdf5fce74dd12be1c882f6c47d1829ec (patch)
tree9e67f3032b6de4be1cf915fd86b439eea6521314 /src/HttpResponseCommand.cc
parentadeead6f0396e2f8551d1182972e277728fd6c8b (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.cc7
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();