diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9a5010c781723bc34fec9b1b22f1ee88fa2e594d..70c5527b2332f2e97ac6ffda7e7a35c7d3baec9f 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 be72421c58387cbe988a99471dfe88e12d8c94bd..b69a1944a62de4c87fbc8b657b1dbcdc775b507a --- 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 1a1564e1a8627477b64c69537450e4fab92652c4..7e24c430170f6daaf7631e70412f0adcc067c596 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2223,6 +2223,7 @@ class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder 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 @@ class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder } } - // 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,