From c904aa50fedd354937cb1dc29044712404c0c785 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 14 Oct 2012 18:05:34 +0900 Subject: Use uri_split instead of uri::parse where appropriate --- src/HttpResponseCommand.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/HttpResponseCommand.cc') diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 780209a4..e85a0329 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -239,9 +239,11 @@ bool HttpResponseCommand::executeInternal() if(getFileEntry()->isUniqueProtocol()) { // Redirection should be considered here. We need to parse // original URI to get hostname. - uri::UriStruct us; - if(uri::parse(us, getRequest()->getUri())) { - getFileEntry()->removeURIWhoseHostnameIs(us.host); + const std::string& uri = getRequest()->getUri(); + uri_split_result us; + if(uri_split(&us, uri.c_str()) == 0) { + std::string host = uri::getFieldString(us, USR_HOST, uri.c_str()); + getFileEntry()->removeURIWhoseHostnameIs(host); } } if(!getPieceStorage()) { -- cgit