diff options
Diffstat (limited to 'linden/indra/llcrashlogger/llcrashlogger.cpp')
-rwxr-xr-x | linden/indra/llcrashlogger/llcrashlogger.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp index 306046a..57fa33b 100755 --- a/linden/indra/llcrashlogger/llcrashlogger.cpp +++ b/linden/indra/llcrashlogger/llcrashlogger.cpp | |||
@@ -76,7 +76,7 @@ bool LLCrashLoggerText::mainLoop() | |||
76 | return true; | 76 | return true; |
77 | } | 77 | } |
78 | 78 | ||
79 | void LLCrashLoggerText::updateApplication(LLString message) | 79 | void LLCrashLoggerText::updateApplication(const std::string& message) |
80 | { | 80 | { |
81 | LLCrashLogger::updateApplication(message); | 81 | LLCrashLogger::updateApplication(message); |
82 | std::cout << message << std::endl; | 82 | std::cout << message << std::endl; |
@@ -147,10 +147,8 @@ void LLCrashLogger::gatherFiles() | |||
147 | updateApplication("Gathering logs..."); | 147 | updateApplication("Gathering logs..."); |
148 | 148 | ||
149 | // Figure out the filename of the debug log | 149 | // Figure out the filename of the debug log |
150 | std::string db_file_name = gDirUtilp->getExpandedFilename( | 150 | std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); |
151 | LL_PATH_LOGS, | 151 | std::ifstream debug_log_file(db_file_name.c_str()); |
152 | "debug_info.log"); | ||
153 | llifstream debug_log_file(db_file_name.c_str()); | ||
154 | 152 | ||
155 | // Look for it in the debug_info.log file | 153 | // Look for it in the debug_info.log file |
156 | if (debug_log_file.is_open()) | 154 | if (debug_log_file.is_open()) |
@@ -191,7 +189,7 @@ void LLCrashLogger::gatherFiles() | |||
191 | { | 189 | { |
192 | // This is a 'little' hacky, but its the best simple solution. | 190 | // This is a 'little' hacky, but its the best simple solution. |
193 | std::string grid_host = mDebugLog["GridName"].asString(); | 191 | std::string grid_host = mDebugLog["GridName"].asString(); |
194 | LLString::toLower(grid_host); | 192 | LLStringUtil::toLower(grid_host); |
195 | 193 | ||
196 | mCrashHost = "https://login."; | 194 | mCrashHost = "https://login."; |
197 | mCrashHost += grid_host; | 195 | mCrashHost += grid_host; |
@@ -207,12 +205,12 @@ void LLCrashLogger::gatherFiles() | |||
207 | 205 | ||
208 | updateApplication("Encoding files..."); | 206 | updateApplication("Encoding files..."); |
209 | 207 | ||
210 | for(std::map<LLString, LLString>::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) | 208 | for(std::map<std::string, std::string>::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) |
211 | { | 209 | { |
212 | std::ifstream f((*itr).second.c_str()); | 210 | std::ifstream f((*itr).second.c_str()); |
213 | if(!f.is_open()) | 211 | if(!f.is_open()) |
214 | { | 212 | { |
215 | std::cout << "Can't find file " << (*itr).second.c_str() << std::endl; | 213 | std::cout << "Can't find file " << (*itr).second << std::endl; |
216 | continue; | 214 | continue; |
217 | } | 215 | } |
218 | std::stringstream s; | 216 | std::stringstream s; |
@@ -265,10 +263,10 @@ bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior) | |||
265 | return true; | 263 | return true; |
266 | } | 264 | } |
267 | 265 | ||
268 | bool LLCrashLogger::runCrashLogPost(LLString host, LLSD data, LLString msg, int retries, int timeout) | 266 | bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout) |
269 | { | 267 | { |
270 | gBreak = false; | 268 | gBreak = false; |
271 | LLString status_message; | 269 | std::string status_message; |
272 | for(int i = 0; i < retries; ++i) | 270 | for(int i = 0; i < retries; ++i) |
273 | { | 271 | { |
274 | status_message = llformat("%s, try %d...", msg.c_str(), i+1); | 272 | status_message = llformat("%s, try %d...", msg.c_str(), i+1); |
@@ -304,14 +302,15 @@ bool LLCrashLogger::sendCrashLogs() | |||
304 | 302 | ||
305 | bool sent = false; | 303 | bool sent = false; |
306 | 304 | ||
305 | //*TODO: Translate | ||
307 | if(mCrashHost != "") | 306 | if(mCrashHost != "") |
308 | { | 307 | { |
309 | sent = runCrashLogPost(mCrashHost, post_data, "Sending to server", 3, 5); | 308 | sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), 3, 5); |
310 | } | 309 | } |
311 | 310 | ||
312 | if(!sent) | 311 | if(!sent) |
313 | { | 312 | { |
314 | sent = runCrashLogPost(mAltCrashHost, post_data, "Sending to alternate server", 3, 5); | 313 | sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3, 5); |
315 | } | 314 | } |
316 | 315 | ||
317 | mSentCrashLogs = sent; | 316 | mSentCrashLogs = sent; |
@@ -319,7 +318,7 @@ bool LLCrashLogger::sendCrashLogs() | |||
319 | return true; | 318 | return true; |
320 | } | 319 | } |
321 | 320 | ||
322 | void LLCrashLogger::updateApplication(LLString message) | 321 | void LLCrashLogger::updateApplication(const std::string& message) |
323 | { | 322 | { |
324 | gServicePump->pump(); | 323 | gServicePump->pump(); |
325 | gServicePump->callback(); | 324 | gServicePump->callback(); |
@@ -372,7 +371,7 @@ bool LLCrashLogger::init() | |||
372 | //If we've opened the crash logger, assume we can delete the marker file if it exists | 371 | //If we've opened the crash logger, assume we can delete the marker file if it exists |
373 | if( gDirUtilp ) | 372 | if( gDirUtilp ) |
374 | { | 373 | { |
375 | LLString marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); | 374 | std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); |
376 | ll_apr_file_remove( marker_file ); | 375 | ll_apr_file_remove( marker_file ); |
377 | } | 376 | } |
378 | 377 | ||