From 118e82e4775c88ace273d6012b5def8b9f19d08f Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 13 Apr 2016 22:40:49 +0100 Subject: MAINT-6305: Serialize the AIS calls by reducing the queue size to 1, move the bake request out of the AIS queue. --- indra/llmessage/llcoproceduremanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index f0fe1ab01b..d4c0788b7d 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -36,7 +36,8 @@ static std::map DefaultPoolSizes = boost::assign::map_list_of (std::string("Upload"), 1) - (std::string("AIS"), 25); + (std::string("AIS"), 1); + // *TODO: Rider for the moment keep AIS calls serialized otherwise the COF will tend to get out of sync. #define DEFAULT_POOL_SIZE 5 -- cgit v1.2.3 From 4d9dd3271b1a015d9afd21767e579a4cd71982ed Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 25 Apr 2016 12:06:33 -0700 Subject: MAINT-6338: Add methods for getting and setting boolean properties from gSavedSettings in the HTTPCore. Use those methods to access new key HTTPLogBodyOnError. Dump body of HTTP message to log in case of error if this key is true. --- indra/llmessage/llcorehttputil.cpp | 38 +++++++++++++++++++++++++++++++++----- indra/llmessage/llcorehttputil.h | 9 ++++++++- 2 files changed, 41 insertions(+), 6 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 9a23ede81b..7742cbc182 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -41,14 +41,41 @@ #include "message.h" // for getting the port -using namespace LLCore; +using namespace LLCore; namespace LLCoreHttpUtil { const F32 HTTP_REQUEST_EXPIRY_SECS = 60.0f; +namespace +{ + const std::string HTTP_LOGBODY_KEY("HTTPLogBodyOnError"); + + BoolSettingQuery_t mBoolSettingGet; + BoolSettingUpdate_t mBoolSettingPut; + + inline bool getBoolSetting(const std::string &keyname) + { + if (!mBoolSettingGet || mBoolSettingGet.empty()) + return(false); + return mBoolSettingGet(HTTP_LOGBODY_KEY); + } + +} + +void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn) +{ + mBoolSettingGet = queryfn; + mBoolSettingPut = updatefn; + + if (mBoolSettingPut && !mBoolSettingPut.empty()) + { + mBoolSettingPut(HTTP_LOGBODY_KEY, false, "Log the entire HTTP body in the case of an HTTP error."); + } +} + void logMessageSuccess(std::string logAuth, std::string url, std::string message) { @@ -293,10 +320,11 @@ void HttpCoroHandler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespons bas >> std::noskipws; bodyData.assign(std::istream_iterator(bas), std::istream_iterator()); httpStatus["error_body"] = LLSD(bodyData); -#if 1 - // commenting out, but keeping since this can be useful for debugging - LL_WARNS() << "Returned body=" << std::endl << httpStatus["error_body"].asString() << LL_ENDL; -#endif + if (getBoolSetting(HTTP_LOGBODY_KEY)) + { + // commenting out, but keeping since this can be useful for debugging + LL_WARNS() << "Returned body=" << std::endl << httpStatus["error_body"].asString() << LL_ENDL; + } } mReplyPump.post(result); diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index d21f5ff45c..6f0b865f83 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -57,7 +57,14 @@ /// namespace LLCoreHttpUtil { - extern const F32 HTTP_REQUEST_EXPIRY_SECS; +/// Allow access to to the property settings methods. +typedef boost::function BoolSettingQuery_t; +typedef boost::function BoolSettingUpdate_t; + +void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn); + + +extern const F32 HTTP_REQUEST_EXPIRY_SECS; /// Attempt to convert a response object's contents to LLSD. /// It is expected that the response body will be of non-zero -- cgit v1.2.3