summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterscriptlimits.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterscriptlimits.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llfloaterscriptlimits.cpp130
1 files changed, 73 insertions, 57 deletions
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index a50907601c..5fbdd75e97 100644..100755
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -58,7 +58,7 @@
// debug switches, won't work in release
#ifndef LL_RELEASE_FOR_DOWNLOAD
-// dump responder replies to llinfos for debugging
+// dump responder replies to LL_INFOS() for debugging
//#define DUMP_REPLIES_TO_LLINFOS
#ifdef DUMP_REPLIES_TO_LLINFOS
@@ -106,7 +106,7 @@ BOOL LLFloaterScriptLimits::postBuild()
if(!mTab)
{
- llwarns << "Error! couldn't get scriptlimits_panels, aborting Script Information setup" << llendl;
+ LL_WARNS() << "Error! couldn't get scriptlimits_panels, aborting Script Information setup" << LL_ENDL;
return FALSE;
}
@@ -183,8 +183,14 @@ void LLPanelScriptLimitsInfo::updateChild(LLUICtrl* child_ctr)
// Responders
///----------------------------------------------------------------------------
-void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
+void fetchScriptLimitsRegionInfoResponder::httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
//we don't need to test with a fake respose here (shouldn't anyway)
#ifdef DUMP_REPLIES_TO_LLINFOS
@@ -195,7 +201,7 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
OSMessageBox(nice_llsd.str(), "main cap response:", 0);
- llinfos << "main cap response:" << content << llendl;
+ LL_INFOS() << "main cap response:" << content << LL_ENDL;
#endif
@@ -210,7 +216,7 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
}
@@ -221,13 +227,14 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
}
}
-void fetchScriptLimitsRegionInfoResponder::error(U32 status, const std::string& reason)
+void fetchScriptLimitsRegionInfoResponder::httpFailure()
{
- llwarns << "Error from responder " << reason << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
-void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
+void fetchScriptLimitsRegionSummaryResponder::httpSuccess()
{
+ const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES
LLSD fake_content;
@@ -268,6 +275,12 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
#endif
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+
#ifdef DUMP_REPLIES_TO_LLINFOS
@@ -277,21 +290,21 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
OSMessageBox(nice_llsd.str(), "summary response:", 0);
- llwarns << "summary response:" << *content << llendl;
+ LL_WARNS() << "summary response:" << *content << LL_ENDL;
#endif
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
else
{
LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
if(tab)
{
- LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
if(panel_memory)
{
panel_memory->getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string("")));
@@ -301,20 +314,21 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
{
btn->setEnabled(true);
}
-
- panel_memory->setRegionSummary(content);
- }
-}
+
+ panel_memory->setRegionSummary(content);
+ }
+ }
}
}
-void fetchScriptLimitsRegionSummaryResponder::error(U32 status, const std::string& reason)
+void fetchScriptLimitsRegionSummaryResponder::httpFailure()
{
- llwarns << "Error from responder " << reason << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
-void fetchScriptLimitsRegionDetailsResponder::result(const LLSD& content_ref)
+void fetchScriptLimitsRegionDetailsResponder::httpSuccess()
{
+ const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES
/*
Updated detail service, ** denotes field added:
@@ -377,6 +391,12 @@ result (map)
#endif
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+
#ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(content);
@@ -385,7 +405,7 @@ result (map)
OSMessageBox(nice_llsd.str(), "details response:", 0);
- llinfos << "details response:" << content << llendl;
+ LL_INFOS() << "details response:" << content << LL_ENDL;
#endif
@@ -393,7 +413,7 @@ result (map)
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
else
{
@@ -407,23 +427,24 @@ result (map)
}
else
{
- llwarns << "Failed to get scriptlimits memory panel" << llendl;
+ LL_WARNS() << "Failed to get scriptlimits memory panel" << LL_ENDL;
}
}
else
{
- llwarns << "Failed to get scriptlimits_panels" << llendl;
+ LL_WARNS() << "Failed to get scriptlimits_panels" << LL_ENDL;
}
}
}
-void fetchScriptLimitsRegionDetailsResponder::error(U32 status, const std::string& reason)
+void fetchScriptLimitsRegionDetailsResponder::httpFailure()
{
- llwarns << "Error from responder " << reason << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
-void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
+void fetchScriptLimitsAttachmentInfoResponder::httpSuccess()
{
+ const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES
@@ -465,6 +486,12 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
#endif
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+
#ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(content);
@@ -473,7 +500,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
OSMessageBox(nice_llsd.str(), "attachment response:", 0);
- llinfos << "attachment response:" << content << llendl;
+ LL_INFOS() << "attachment response:" << content << LL_ENDL;
#endif
@@ -481,7 +508,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
else
{
@@ -503,19 +530,19 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
}
else
{
- llwarns << "Failed to get script_limits_my_avatar_panel" << llendl;
+ LL_WARNS() << "Failed to get script_limits_my_avatar_panel" << LL_ENDL;
}
}
else
{
- llwarns << "Failed to get scriptlimits_panels" << llendl;
+ LL_WARNS() << "Failed to get scriptlimits_panels" << LL_ENDL;
}
}
}
-void fetchScriptLimitsAttachmentInfoResponder::error(U32 status, const std::string& reason)
+void fetchScriptLimitsAttachmentInfoResponder::httpFailure()
{
- llwarns << "Error from responder " << reason << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
///----------------------------------------------------------------------------
@@ -586,9 +613,9 @@ void LLPanelScriptLimitsRegionMemory::setParcelID(const LLUUID& parcel_id)
}
// virtual
-void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::string& reason)
+void LLPanelScriptLimitsRegionMemory::setErrorStatus(S32 status, const std::string& reason)
{
- llwarns << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl;
+ LL_WARNS() << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<LL_ENDL;
}
// callback from the name cache with an owner name to add to the list
@@ -602,15 +629,7 @@ void LLPanelScriptLimitsRegionMemory::onNameCache(
return;
}
- std::string name;
- if (LLAvatarNameCache::useDisplayNames())
- {
- name = LLCacheName::buildUsername(full_name);
- }
- else
- {
- name = full_name;
- }
+ std::string name = LLCacheName::buildUsername(full_name);
std::vector<LLSD>::iterator id_itor;
for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor)
@@ -635,7 +654,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
if(!list)
{
- llwarns << "Error getting the scripts_list control" << llendl;
+ LL_WARNS() << "Error getting the scripts_list control" << LL_ENDL;
return;
}
@@ -713,10 +732,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
else
{
name_is_cached = gCacheName->getFullName(owner_id, owner_buf); // username
- if (LLAvatarNameCache::useDisplayNames())
- {
- owner_buf = LLCacheName::buildUsername(owner_buf);
- }
+ owner_buf = LLCacheName::buildUsername(owner_buf);
}
if(!name_is_cached)
{
@@ -811,7 +827,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
}
else
{
- llwarns << "summary doesn't contain memory info" << llendl;
+ LL_WARNS() << "summary doesn't contain memory info" << LL_ENDL;
return;
}
@@ -829,7 +845,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
}
else
{
- llwarns << "summary doesn't contain urls info" << llendl;
+ LL_WARNS() << "summary doesn't contain urls info" << LL_ENDL;
return;
}
@@ -933,9 +949,9 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
}
else
{
- llwarns << "Can't get parcel info for script information request" << region_id
+ LL_WARNS() << "Can't get parcel info for script information request" << region_id
<< ". Region: " << region->getName()
- << " does not support RemoteParcelRequest" << llendl;
+ << " does not support RemoteParcelRequest" << LL_ENDL;
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting));
@@ -1001,7 +1017,7 @@ void LLPanelScriptLimitsRegionMemory::onClickRefresh(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << LL_ENDL;
return;
}
}
@@ -1047,7 +1063,7 @@ void LLPanelScriptLimitsRegionMemory::onClickHighlight(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << LL_ENDL;
return;
}
}
@@ -1152,7 +1168,7 @@ void LLPanelScriptLimitsRegionMemory::onClickReturn(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << LL_ENDL;
return;
}
}
@@ -1284,7 +1300,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content)
}
else
{
- llwarns << "attachment details don't contain memory summary info" << llendl;
+ LL_WARNS() << "attachment details don't contain memory summary info" << LL_ENDL;
return;
}
@@ -1302,7 +1318,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content)
}
else
{
- llwarns << "attachment details don't contain urls summary info" << llendl;
+ LL_WARNS() << "attachment details don't contain urls summary info" << LL_ENDL;
return;
}
@@ -1354,7 +1370,7 @@ void LLPanelScriptLimitsAttachment::onClickRefresh(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << LL_ENDL;
return;
}
}