void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
{

#ifdef USE_FAKE_RESPONSES

	// just add the summary, as that's all I'm testing currently!
	LLSD fake_content = LLSD::emptyMap();
	LLSD summary = LLSD::emptyMap();
	LLSD available = LLSD::emptyArray();
	LLSD available_urls = LLSD::emptyMap();
	LLSD available_memory = LLSD::emptyMap();
	LLSD used = LLSD::emptyArray();
	LLSD used_urls = LLSD::emptyMap();
	LLSD used_memory = LLSD::emptyMap();

	used_urls["type"] = "urls";
	used_urls["amount"] = FAKE_NUMBER_OF_URLS;
	available_urls["type"] = "urls";
	available_urls["amount"] = FAKE_AVAILABLE_URLS;
	used_memory["type"] = "memory";
	used_memory["amount"] = FAKE_AMOUNT_OF_MEMORY;
	available_memory["type"] = "memory";
	available_memory["amount"] = FAKE_AVAILABLE_MEMORY;

	used.append(used_urls);
	used.append(used_memory);
	available.append(available_urls);
	available.append(available_memory);

	summary["available"] = available;
	summary["used"] = used;
	
	fake_content["summary"] = summary;
	fake_content["attachments"] = content_ref["attachments"];

	const LLSD& content = fake_content;

#else

	const LLSD& content = content_ref;

#endif

#ifdef DUMP_REPLIES_TO_LLINFOS

	LLSDNotationStreamer notation_streamer(content);
	std::ostringstream nice_llsd;
	nice_llsd << notation_streamer;

	OSMessageBox(nice_llsd.str(), "attachment response:", 0);
	
	llinfos << "attachment response:" << content << llendl;

#endif

	LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");

	if(!instance)
	{
		llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
	}
	else
	{
		LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
		if(tab)
		{
			LLPanelScriptLimitsAttachment* panel = (LLPanelScriptLimitsAttachment*)tab->getChild<LLPanel>("script_limits_my_avatar_panel");
			if(panel)
			{
				panel->childSetValue("loading_text", LLSD(std::string("")));

				LLButton* btn = panel->getChild<LLButton>("refresh_list_btn");
				if(btn)
				{
					btn->setEnabled(true);
				}
			
				panel->setAttachmentDetails(content);
			}
			else
			{
				llwarns << "Failed to get script_limits_my_avatar_panel" << llendl;
			}
		}
		else
		{
			llwarns << "Failed to get scriptlimits_panels" << llendl;
		}
	}
}
void fetchScriptLimitsAttachmentInfoResponder::httpSuccess()
{
	const LLSD& content_ref = getContent();

#ifdef USE_FAKE_RESPONSES

	// just add the summary, as that's all I'm testing currently!
	LLSD fake_content = LLSD::emptyMap();
	LLSD summary = LLSD::emptyMap();
	LLSD available = LLSD::emptyArray();
	LLSD available_urls = LLSD::emptyMap();
	LLSD available_memory = LLSD::emptyMap();
	LLSD used = LLSD::emptyArray();
	LLSD used_urls = LLSD::emptyMap();
	LLSD used_memory = LLSD::emptyMap();

	used_urls["type"] = "urls";
	used_urls["amount"] = FAKE_NUMBER_OF_URLS;
	available_urls["type"] = "urls";
	available_urls["amount"] = FAKE_AVAILABLE_URLS;
	used_memory["type"] = "memory";
	used_memory["amount"] = FAKE_AMOUNT_OF_MEMORY;
	available_memory["type"] = "memory";
	available_memory["amount"] = FAKE_AVAILABLE_MEMORY;

	used.append(used_urls);
	used.append(used_memory);
	available.append(available_urls);
	available.append(available_memory);

	summary["available"] = available;
	summary["used"] = used;

	fake_content["summary"] = summary;
	fake_content["attachments"] = content_ref["attachments"];

	const LLSD& content = fake_content;

#else

	const LLSD& content = content_ref;

#endif

	if (!content.isMap())
	{
		failureResult(HTTP_INTERNAL_ERROR_OTHER, "Malformed response contents", content);
		return;
	}

#ifdef DUMP_REPLIES_TO_LLINFOS

	LLSDNotationStreamer notation_streamer(content);
	std::ostringstream nice_llsd;
	nice_llsd << notation_streamer;

	OSMessageBox(nice_llsd.str(), "attachment response:", 0);

	LL_INFOS() << "attachment response:" << content << LL_ENDL;

#endif

	LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance();

	if(!instance)
	{
		LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
	}
	else
	{
		LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
		if(tab)
		{
			LLPanelScriptLimitsAttachment* panel = (LLPanelScriptLimitsAttachment*)tab->getChild<LLPanel>("script_limits_my_avatar_panel");
			if(panel)
			{
				panel->getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string("")));

				LLButton* btn = panel->getChild<LLButton>("refresh_list_btn");
				if(btn)
				{
					btn->setEnabled(true);
				}

				panel->setAttachmentDetails(content);
			}
			else
			{
				LL_WARNS() << "Failed to get script_limits_my_avatar_panel" << LL_ENDL;
			}
		}
		else
		{
			LL_WARNS() << "Failed to get scriptlimits_panels" << LL_ENDL;
		}
	}
}