diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-04-03 19:21:14 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-04-03 19:21:14 +0000 |
commit | b5936a4b1d8780b5b8cd425998eacd2c64ffa693 (patch) | |
tree | c1581bcf34e96a897c6e1d9a4aed95f353713baa /indra/llcrashlogger/llcrashlogger.cpp | |
parent | 55c25229b79b1755c989e5996c8e8d118f369721 (diff) |
1.19.1 Viewer merge: QAR_367, QAR-374, QAR-408, QAR-426
QAR_367 (RC1) - merge Branch_1-19-1-Viewer -r 81609 : 81993 -> release
QAR-374 (RC2) - merge Branch_1-19-1-Viewer -r 81993 : 82589 -> release
QAR-408 (RC3) - merge Branch_1-19-1-Viewer -r 82589 : 83128 -> release
QAR-426 (rc4) - merge Branch_1-19-1-Viewer -r 83125 : 83719 -> release
(Actual merge: release@83793 Branch_1-19-1-Viewer-merge@83953 -> release)
Diffstat (limited to 'indra/llcrashlogger/llcrashlogger.cpp')
-rwxr-xr-x | indra/llcrashlogger/llcrashlogger.cpp | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index c8b5f06b49..2640390b9c 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -85,7 +85,8 @@ void LLCrashLoggerText::updateApplication(LLString message) LLCrashLogger::LLCrashLogger() : mCrashBehavior(CRASH_BEHAVIOR_ASK), mCrashInPreviousExec(false), - mSentCrashLogs(false) + mSentCrashLogs(false), + mCrashHost("") { } @@ -145,21 +146,14 @@ void LLCrashLogger::gatherFiles() gatherPlatformSpecificFiles(); //Use the debug log to reconstruct the URL to send the crash report to - mCrashHost = "https://"; - mCrashHost += mDebugLog["CurrentSimHost"].asString(); - mCrashHost += ":12043/crash/report"; - // Use login servers as the alternate, since they are already load balanced and have a known name - // First, check to see if we have a valid grid name. If not, use agni. - mAltCrashHost = "https://login."; - if(mDebugLog["GridName"].asString() != "") - { - mAltCrashHost += mDebugLog["GridName"].asString(); - } - else + if(mDebugLog.has("CurrentSimHost")) { - mAltCrashHost += "agni"; + mCrashHost = "https://"; + mCrashHost += mDebugLog["CurrentSimHost"].asString(); + mCrashHost += ":12043/crash/report"; } - mAltCrashHost += ".lindenlab.com:12043/crash/report"; + // Use login servers as the alternate, since they are already load balanced and have a known name + mAltCrashHost = "https://login.agni.lindenlab.com:12043/crash/report"; mCrashInfo["DebugLog"] = mDebugLog; mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stats.log"); @@ -218,6 +212,26 @@ bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior) return true; } +bool LLCrashLogger::runCrashLogPost(LLString host, LLSD data, LLString msg, int retries, int timeout) +{ + gBreak = false; + LLString status_message; + for(int i = 0; i < retries; ++i) + { + status_message = llformat("%s, try %d...", msg.c_str(), i+1); + LLHTTPClient::post(host, data, new LLCrashLoggerResponder(), timeout); + while(!gBreak) + { + updateApplication(status_message); + } + if(gSent) + { + return gSent; + } + } + return gSent; +} + bool LLCrashLogger::sendCrashLogs() { gatherFiles(); @@ -234,27 +248,20 @@ bool LLCrashLogger::sendCrashLogs() std::ofstream out_file(report_file.c_str()); LLSDSerialize::toPrettyXML(post_data, out_file); out_file.close(); - LLHTTPClient::post(mCrashHost, post_data, new LLCrashLoggerResponder(), 5); - gBreak = false; - while(!gBreak) + bool sent = false; + + if(mCrashHost != "") { - updateApplication("Sending logs..."); + sent = runCrashLogPost(mCrashHost, post_data, "Sending to server", 3, 5); } - if(!gSent) + if(!sent) { - gBreak = false; - LLHTTPClient::post(mAltCrashHost, post_data, new LLCrashLoggerResponder(), 5); - - while(!gBreak) - { - updateApplication("Sending logs to Alternate Server..."); - } + sent = runCrashLogPost(mAltCrashHost, post_data, "Sending to alternate server", 3, 5); } - - mSentCrashLogs = gSent; + mSentCrashLogs = sent; return true; } |