summaryrefslogtreecommitdiff
path: root/src/HttpResponseCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-09-11 12:09:19 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-09-11 12:09:19 +0000
commit80edde0205f8065bca84ab7acee9f38c021864b1 (patch)
treed714d4ee84f11a4ec98af6931f1fcb7f8bded7ac /src/HttpResponseCommand.cc
parentec3bd81486d6f9b266753984f0da31f8d39fd951 (diff)
2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use uri::parse instead of Request::setUri() where just URI parser is needed. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/DefaultBtAnnounce.cc * src/FeedbackURISelector.cc * src/FileEntry.cc * src/HttpResponseCommand.cc * src/ProtocolDetector.cc * src/Request.cc * src/RequestGroupMan.cc
Diffstat (limited to 'src/HttpResponseCommand.cc')
-rw-r--r--src/HttpResponseCommand.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc
index 74b1c659..43722709 100644
--- a/src/HttpResponseCommand.cc
+++ b/src/HttpResponseCommand.cc
@@ -73,6 +73,7 @@
#include "SinkStreamFilter.h"
#include "ChunkedDecodingStreamFilter.h"
#include "GZipDecodingStreamFilter.h"
+#include "uri.h"
namespace aria2 {
@@ -155,9 +156,10 @@ bool HttpResponseCommand::executeInternal()
if(getFileEntry()->isUniqueProtocol()) {
// Redirection should be considered here. We need to parse
// original URI to get hostname.
- Request req;
- req.setUri(getRequest()->getUri());
- getFileEntry()->removeURIWhoseHostnameIs(req.getHost());
+ uri::UriStruct us;
+ if(uri::parse(us, getRequest()->getUri())) {
+ getFileEntry()->removeURIWhoseHostnameIs(us.host);
+ }
}
if(getPieceStorage().isNull()) {
uint64_t totalLength = httpResponse->getEntityLength();