diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-10-14 18:05:34 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-10-14 18:05:34 +0900 |
| commit | c904aa50fedd354937cb1dc29044712404c0c785 (patch) | |
| tree | 934c3194f9b5ca733945edd9c8c737dec35040c5 /src/HttpResponseCommand.cc | |
| parent | eebc704b1933e5e43ff38cd37adb48d3daef1aad (diff) | |
Use uri_split instead of uri::parse where appropriate
Diffstat (limited to 'src/HttpResponseCommand.cc')
| -rw-r--r-- | src/HttpResponseCommand.cc | 8 |
1 files changed, 5 insertions, 3 deletions
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()) { |
