From 741821eb6a8717896307da44b1b8e7078a865fff Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 15 Feb 2013 09:52:11 -0500 Subject: SH-3867 FIX - on logout, wait for any pending metrics uploads to complete --- indra/newview/llappviewer.cpp | 9 +++++++++ indra/newview/llappviewer.h | 2 ++ indra/newview/llvoavatarself.cpp | 7 ++----- 3 files changed, 13 insertions(+), 5 deletions(-) mode change 100644 => 100755 indra/newview/llappviewer.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9a5010c781..70c5527b23 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -291,6 +291,8 @@ LLTimer gLogoutTimer; static const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutReply msg. F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME; +S32 gPendingMetricsUploads = 0; + BOOL gDisconnected = FALSE; // used to restore texture state after a mode switch @@ -4725,6 +4727,13 @@ void LLAppViewer::idleShutdown() return; } + if (gPendingMetricsUploads > 0 + && gLogoutTimer.getElapsedTimeF32() < SHUTDOWN_UPLOAD_SAVE_TIME + && !logoutRequestSent()) + { + return; + } + // All floaters are closed. Tell server we want to quit. if( !logoutRequestSent() ) { diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h old mode 100644 new mode 100755 index be72421c58..b69a1944a6 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -341,6 +341,8 @@ extern LLFrameTimer gLoggedInTime; extern F32 gLogoutMaxTime; extern LLTimer gLogoutTimer; +extern S32 gPendingMetricsUploads; + extern F32 gSimLastTime; extern F32 gSimFrames; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 1a1564e1a8..7e24c43017 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2223,6 +2223,7 @@ public: const std::string& reason, const LLSD& content) { + gPendingMetricsUploads--; // if we add retry, this should be moved to the isGoodStatus case. if (isGoodStatus(status)) { LL_DEBUGS("Avatar") << "OK" << LL_ENDL; @@ -2235,11 +2236,6 @@ public: } } - // virtual - void error(U32 status_num, const std::string & reason) - { - } - // virtual void result(const LLSD & content) { @@ -2384,6 +2380,7 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() } if (!caps_url.empty()) { + gPendingMetricsUploads++; LLCurlRequest::headers_t headers; LLHTTPClient::post(caps_url, msg, -- cgit v1.2.3