summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2017-07-26 17:12:43 +0000
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2017-07-26 17:12:43 +0000
commitfe57538d2f96f37cf7f7590e0d2bfd8b907f3e68 (patch)
tree847424ba546da34a6eba688614c6cfb2153e96cf /indra/newview
parent822183057b13c8187d9dab68232b4274bc3ec3b2 (diff)
parent1a5fa01fb894d8e7da575d313fd5270fe4289ca7 (diff)
Merged MAINT-7495 Viewer retries too many times apon 504 from login.cgi
Approved-by: Simon Linden <simon@lindenlab.com> Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com> Approved-by: Oz Linden <oz@lindenlab.com> Approved-by: Maxim Nikolenko <maximnproductengine@lindenlab.com>
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml4
-rw-r--r--indra/newview/lllogininstance.cpp11
-rw-r--r--indra/newview/llxmlrpclistener.cpp2
-rw-r--r--indra/newview/llxmlrpctransaction.cpp26
-rw-r--r--indra/newview/llxmlrpctransaction.h2
5 files changed, 29 insertions, 16 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 0303581d62..4154c96378 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5592,12 +5592,12 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>10.0</real>
+ <real>40.0</real>
</map>
<key>LoginSRVPump</key>
<map>
<key>Comment</key>
- <string>Name of the message pump that handles SRV request</string>
+ <string>Name of the message pump that handles SRV request (deprecated)</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index b4d0bb6823..40e98947a3 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -63,6 +63,8 @@
#include <boost/scoped_ptr.hpp>
#include <sstream>
+const S32 LOGIN_MAX_RETRIES = 3;
+
class LLLoginInstance::Disposable {
public:
virtual ~Disposable() {}
@@ -610,13 +612,16 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
request_params["host_id"] = gSavedSettings.getString("HostID");
request_params["extended_errors"] = true; // request message_id and message_args
+ // Specify desired timeout/retry options
+ LLSD http_params;
+ http_params["timeout"] = gSavedSettings.getF32("LoginSRVTimeout");
+ http_params["retries"] = LOGIN_MAX_RETRIES;
+
mRequestData.clear();
mRequestData["method"] = "login_to_simulator";
mRequestData["params"] = request_params;
mRequestData["options"] = requested_options;
-
- mRequestData["cfg_srv_timeout"] = gSavedSettings.getF32("LoginSRVTimeout");
- mRequestData["cfg_srv_pump"] = gSavedSettings.getString("LoginSRVPump");
+ mRequestData["http_params"] = http_params;
}
bool LLLoginInstance::handleLoginEvent(const LLSD& event)
diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp
index cc3645131d..99070d5bee 100644
--- a/indra/newview/llxmlrpclistener.cpp
+++ b/indra/newview/llxmlrpclistener.cpp
@@ -312,7 +312,7 @@ public:
}
XMLRPC_RequestSetData(request, xparams);
- mTransaction.reset(new LLXMLRPCTransaction(mUri, request));
+ mTransaction.reset(new LLXMLRPCTransaction(mUri, request, true, command.has("http_params")? LLSD(command["http_params"]) : LLSD()));
mPreviousStatus = mTransaction->status(NULL);
// Free the XMLRPC_REQUEST object and the attached data values.
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index f8b38669b6..0c8495a6e4 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -208,7 +208,7 @@ public:
std::string mCertStore;
LLPointer<LLCertificate> mErrorCert;
- Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip);
+ Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams);
Impl(const std::string& uri,
const std::string& method, LLXMLRPCValue params, bool useGzip);
~Impl();
@@ -219,7 +219,7 @@ public:
void setHttpStatus(const LLCore::HttpStatus &status);
private:
- void init(XMLRPC_REQUEST request, bool useGzip);
+ void init(XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams);
};
LLXMLRPCTransaction::Handler::Handler(LLCore::HttpRequest::ptr_t &request,
@@ -315,13 +315,13 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle,
//=========================================================================
LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
- XMLRPC_REQUEST request, bool useGzip)
+ XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams)
: mHttpRequest(),
mStatus(LLXMLRPCTransaction::StatusNotStarted),
mURI(uri),
mResponse(0)
{
- init(request, useGzip);
+ init(request, useGzip, httpParams);
}
@@ -337,7 +337,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
XMLRPC_RequestSetRequestType(request, xmlrpc_request_call);
XMLRPC_RequestSetData(request, params.getValue());
- init(request, useGzip);
+ init(request, useGzip, LLSD());
// DEV-28398: without this XMLRPC_RequestFree() call, it looks as though
// the 'request' object is simply leaked. It's less clear to me whether we
// should also ask to free request value data (second param 1), since the
@@ -345,7 +345,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri,
XMLRPC_RequestFree(request, 1);
}
-void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
+void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams)
{
LLCore::HttpOptions::ptr_t httpOpts;
LLCore::HttpHeaders::ptr_t httpHeaders;
@@ -359,7 +359,15 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
// LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer
httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions());
- httpOpts->setTimeout(40L);
+ // delay between repeats will start from 5 sec and grow to 20 sec with each repeat
+ httpOpts->setMinBackoff(5E6L);
+ httpOpts->setMaxBackoff(20E6L);
+
+ httpOpts->setTimeout(httpParams.has("timeout") ? httpParams["timeout"].asInteger() : 40L);
+ if (httpParams.has("retries"))
+ {
+ httpOpts->setRetries(httpParams["retries"].asInteger());
+ }
bool vefifySSLCert = !gSavedSettings.getBOOL("NoVerifySSLCert");
mCertStore = gSavedSettings.getString("CertStore");
@@ -526,8 +534,8 @@ void LLXMLRPCTransaction::Impl::setHttpStatus(const LLCore::HttpStatus &status)
LLXMLRPCTransaction::LLXMLRPCTransaction(
- const std::string& uri, XMLRPC_REQUEST request, bool useGzip)
-: impl(* new Impl(uri, request, useGzip))
+ const std::string& uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams)
+: impl(* new Impl(uri, request, useGzip, httpParams))
{ }
diff --git a/indra/newview/llxmlrpctransaction.h b/indra/newview/llxmlrpctransaction.h
index 3a1c9c82b7..7a9bc991f7 100644
--- a/indra/newview/llxmlrpctransaction.h
+++ b/indra/newview/llxmlrpctransaction.h
@@ -85,7 +85,7 @@ class LLXMLRPCTransaction
{
public:
LLXMLRPCTransaction(const std::string& uri,
- XMLRPC_REQUEST request, bool useGzip = true);
+ XMLRPC_REQUEST request, bool useGzip = true, const LLSD& httpParams = LLSD());
// does not take ownership of the request object
// request can be freed as soon as the transaction is constructed