summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2016-05-06 10:28:42 -0400
committerOz Linden <oz@lindenlab.com>2016-05-06 10:28:42 -0400
commit950c41d184b340a7a3370c2cbda5d1eed9a17b0b (patch)
tree373912394af6834d7d56258becf46954244b8423 /indra/llmessage
parent20198b750d02c769ab6845226f98ce6e5dd1f20b (diff)
parent7f5e6cea124e1193b199a3eabd50bdab96340c13 (diff)
merge 4.0.4-release and MAINT-5974
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llcoproceduremanager.cpp3
-rw-r--r--indra/llmessage/llcorehttputil.cpp38
-rw-r--r--indra/llmessage/llcorehttputil.h9
3 files changed, 43 insertions, 7 deletions
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<std::string, U32> 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
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<U8>(bas), std::istream_iterator<U8>());
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<bool(const std::string &)> BoolSettingQuery_t;
+typedef boost::function<void(const std::string &, bool, const std::string &)> 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