diff options
Diffstat (limited to 'linden/indra/llcrashlogger/llcrashlogger.cpp')
-rwxr-xr-x | linden/indra/llcrashlogger/llcrashlogger.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp index 948932f..0fd8f63 100755 --- a/linden/indra/llcrashlogger/llcrashlogger.cpp +++ b/linden/indra/llcrashlogger/llcrashlogger.cpp | |||
@@ -96,6 +96,33 @@ LLCrashLogger::~LLCrashLogger() | |||
96 | 96 | ||
97 | } | 97 | } |
98 | 98 | ||
99 | // TRIM_SIZE must remain larger than LINE_SEARCH_SIZE. | ||
100 | const int TRIM_SIZE = 128000; | ||
101 | const int LINE_SEARCH_DIST = 500; | ||
102 | const std::string SKIP_TEXT = "\n ...Skipping... \n"; | ||
103 | void trimSLLog(std::string& sllog) | ||
104 | { | ||
105 | if(sllog.length() > TRIM_SIZE * 2) | ||
106 | { | ||
107 | std::string::iterator head = sllog.begin() + TRIM_SIZE; | ||
108 | std::string::iterator tail = sllog.begin() + sllog.length() - TRIM_SIZE; | ||
109 | std::string::iterator new_head = std::find(head, head - LINE_SEARCH_DIST, '\n'); | ||
110 | if(new_head != head - LINE_SEARCH_DIST) | ||
111 | { | ||
112 | head = new_head; | ||
113 | } | ||
114 | |||
115 | std::string::iterator new_tail = std::find(tail, tail + LINE_SEARCH_DIST, '\n'); | ||
116 | if(new_tail != tail + LINE_SEARCH_DIST) | ||
117 | { | ||
118 | tail = new_tail; | ||
119 | } | ||
120 | |||
121 | sllog.erase(head, tail); | ||
122 | sllog.insert(head, SKIP_TEXT.begin(), SKIP_TEXT.end()); | ||
123 | } | ||
124 | } | ||
125 | |||
99 | void LLCrashLogger::gatherFiles() | 126 | void LLCrashLogger::gatherFiles() |
100 | { | 127 | { |
101 | 128 | ||
@@ -152,6 +179,17 @@ void LLCrashLogger::gatherFiles() | |||
152 | mCrashHost += mDebugLog["CurrentSimHost"].asString(); | 179 | mCrashHost += mDebugLog["CurrentSimHost"].asString(); |
153 | mCrashHost += ":12043/crash/report"; | 180 | mCrashHost += ":12043/crash/report"; |
154 | } | 181 | } |
182 | else if(mDebugLog.has("GridName")) | ||
183 | { | ||
184 | // This is a 'little' hacky, but its the best simple solution. | ||
185 | std::string grid_host = mDebugLog["GridName"].asString(); | ||
186 | LLString::toLower(grid_host); | ||
187 | |||
188 | mCrashHost = "https://login."; | ||
189 | mCrashHost += grid_host; | ||
190 | mCrashHost += ".lindenlab.com:12043/crash/report"; | ||
191 | } | ||
192 | |||
155 | // Use login servers as the alternate, since they are already load balanced and have a known name | 193 | // Use login servers as the alternate, since they are already load balanced and have a known name |
156 | mAltCrashHost = "https://login.agni.lindenlab.com:12043/crash/report"; | 194 | mAltCrashHost = "https://login.agni.lindenlab.com:12043/crash/report"; |
157 | 195 | ||
@@ -171,7 +209,14 @@ void LLCrashLogger::gatherFiles() | |||
171 | } | 209 | } |
172 | std::stringstream s; | 210 | std::stringstream s; |
173 | s << f.rdbuf(); | 211 | s << f.rdbuf(); |
174 | mCrashInfo[(*itr).first] = s.str(); | 212 | |
213 | std::string crash_info = s.str(); | ||
214 | if(itr->first == "SecondLifeLog") | ||
215 | { | ||
216 | trimSLLog(crash_info); | ||
217 | } | ||
218 | |||
219 | mCrashInfo[(*itr).first] = crash_info; | ||
175 | } | 220 | } |
176 | } | 221 | } |
177 | 222 | ||