diff options
Diffstat (limited to 'indra/llcommon/lluriparser.cpp')
-rw-r--r-- | indra/llcommon/lluriparser.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index ef4481d32f..d07288f123 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -175,29 +175,58 @@ S32 LLUriParser::normalize() if (!mRes) { mNormalizedUri = &label_buf[mTmpScheme ? 7 : 0]; + mTmpScheme = false; } } } } + if(mTmpScheme) + { + mNormalizedUri = mNormalizedUri.substr(7); + mTmpScheme = false; + } + return mRes; } void LLUriParser::glue(std::string& uri) const { + std::string first_part; + glueFirst(first_part); + + std::string second_part; + glueSecond(second_part); + + uri = first_part + second_part; +} + +void LLUriParser::glueFirst(std::string& uri) const +{ if (mScheme.size()) { uri = mScheme; uri += "://"; } + else + { + uri.clear(); + } uri += mHost; +} +void LLUriParser::glueSecond(std::string& uri) const +{ if (mPort.size()) { - uri += ':'; + uri = ':'; uri += mPort; } + else + { + uri.clear(); + } uri += mPath; |