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
This commit is contained in:
Tatsuhiro Tsujikawa 2010-09-11 12:09:19 +00:00
parent ec3bd81486
commit 80edde0205
10 changed files with 76 additions and 40 deletions

View file

@ -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();