summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llcachename.cpp39
-rw-r--r--indra/llmessage/llcurl.cpp24
2 files changed, 46 insertions, 17 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 522b99bc02..a8f53a38c3 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -556,25 +556,38 @@ std::string LLCacheName::buildUsername(const std::string& full_name)
//static
std::string LLCacheName::buildLegacyName(const std::string& complete_name)
{
- boost::regex complete_name_regex("(.+)( \\()([A-Za-z]+)(.[A-Za-z]+)*(\\))");
- boost::match_results<std::string::const_iterator> name_results;
- if (!boost::regex_match(complete_name, name_results, complete_name_regex)) return complete_name;
+ // regexp doesn't play nice with unicode, chop off the display name
+ S32 open_paren = complete_name.rfind(" (");
- std::string legacy_name = name_results[3];
+ if (open_paren == std::string::npos)
+ {
+ return complete_name;
+ }
+
+ std::string username = complete_name.substr(open_paren);
+ boost::regex complete_name_regex("( \\()([a-z0-9]+)(.[a-z]+)*(\\))");
+ boost::match_results<std::string::const_iterator> name_results;
+ if (!boost::regex_match(username, name_results, complete_name_regex)) return complete_name;
+
+ std::string legacy_name = name_results[2];
// capitalize the first letter
std::string cap_letter = legacy_name.substr(0, 1);
LLStringUtil::toUpper(cap_letter);
- legacy_name = cap_letter + legacy_name.substr(1);
-
- if (name_results[4].matched)
- {
- std::string last_name = name_results[4];
+ legacy_name = cap_letter + legacy_name.substr(1);
+
+ if (name_results[3].matched)
+ {
+ std::string last_name = name_results[3];
std::string cap_letter = last_name.substr(1, 1);
LLStringUtil::toUpper(cap_letter);
- last_name = cap_letter + last_name.substr(2);
- legacy_name = legacy_name + " " + last_name;
- }
-
+ last_name = cap_letter + last_name.substr(2);
+ legacy_name = legacy_name + " " + last_name;
+ }
+ else
+ {
+ legacy_name = legacy_name + " Resident";
+ }
+
return legacy_name;
}
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 66f1ffd41b..6473b23e80 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -89,15 +89,29 @@ void check_curl_code(CURLcode code)
{
if (code != CURLE_OK)
{
- llerrs << "curl error detected: " << curl_easy_strerror(code) << llendl;
+ // linux appears to throw a curl error once per session for a bad initialization
+ // at a pretty random time (when enabling cookies). Making curl errors non-asserts
+ // for non-windows platforms for now. - Nyx
+ #if LL_WINDOWS
+ llerrs << "curl error detected: " << curl_easy_strerror(code) << llendl;
+ #else
+ llinfos << "curl error detected: " << curl_easy_strerror(code) << llendl;
+ #endif
}
}
-void check_curl_multi_code(CURLMcode code)
+void check_curl_multi_code(CURLMcode code)
{
if (code != CURLM_OK)
{
- llerrs << "curl multi error detected: " << curl_multi_strerror(code) << llendl;
+ // linux appears to throw a curl error once per session for a bad initialization
+ // at a pretty random time (when enabling cookies). Making curl errors non-asserts
+ // for non-windows platforms for now. - Nyx
+ #if LL_WINDOWS
+ llerrs << "curl multi error detected: " << curl_multi_strerror(code) << llendl;
+ #else
+ llinfos << "curl multi error detected: " << curl_multi_strerror(code) << llendl;
+ #endif
}
}
@@ -1160,7 +1174,9 @@ void LLCurl::initClass()
// Do not change this "unless you are familiar with and mean to control
// internal operations of libcurl"
// - http://curl.haxx.se/libcurl/c/curl_global_init.html
- curl_global_init(CURL_GLOBAL_ALL);
+ CURLcode code = curl_global_init(CURL_GLOBAL_ALL);
+
+ check_curl_code(code);
Easy::sHandleMutex = new LLMutex(NULL);