summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llagent.cpp35
-rwxr-xr-xindra/newview/llagent.h15
-rwxr-xr-xindra/newview/llappcorehttp.cpp6
-rwxr-xr-xindra/newview/llappcorehttp.h2
-rwxr-xr-xindra/newview/llappearancemgr.cpp3
5 files changed, 48 insertions, 13 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index ff0e2c42c1..81387fb927 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -472,7 +472,7 @@ void LLAgent::init()
mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest());
mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders(), false);
mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions(), false);
- mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_AVATAR);
+ mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_AGENT);
doOnIdleRepeating(boost::bind(&LLAgent::onIdle, this));
@@ -2563,7 +2563,7 @@ protected:
virtual void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status);
private:
- U8 LLMaturityHttpHandler::parseMaturityFromServerResponse(const LLSD &pContent) const;
+ U8 parseMaturityFromServerResponse(const LLSD &pContent) const;
LLAgent * mAgent;
U8 mPreferredMaturity;
@@ -2774,20 +2774,39 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
LL_INFOS() << "Sending viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreferredMaturity)
<< "' via capability to: " << url << LL_ENDL;
- LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,
- mHttpPolicy, mHttpPriority, url,
- postData, mHttpOptions, mHttpHeaders, handler);
+ LLCore::HttpHandle handle = requestPostCapibility("UpdateAgentInformation", url, postData, handler);
if (handle == LLCORE_HTTP_HANDLE_INVALID)
{
delete handler;
- LLCore::HttpStatus status = mHttpRequest->getStatus();
- LL_WARNS("Avatar") << "Maturity request post failed Reason " << status.toTerseString()
- << " \"" << status.toString() << "\"" << LL_ENDL;
+ LL_WARNS("Avatar") << "Maturity request post failed." << LL_ENDL;
}
}
}
+LLCore::HttpHandle LLAgent::requestPostCapibility(const std::string &cap, const std::string &url, LLSD &postData, LLHttpSDHandler *usrhndlr)
+{
+ LLHttpSDHandler * handler = (usrhndlr) ? usrhndlr : new LLHttpSDGenericHandler(url, cap);
+ LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,
+ mHttpPolicy, mHttpPriority, url,
+ postData, mHttpOptions, mHttpHeaders, handler);
+
+ if (handle == LLCORE_HTTP_HANDLE_INVALID)
+ {
+ if (!usrhndlr)
+ delete handler;
+ LLCore::HttpStatus status = mHttpRequest->getStatus();
+ LL_WARNS("Avatar") << "'" << cap << "' request POST failed. Reason "
+ << status.toTerseString() << " \"" << status.toString() << "\"" << LL_ENDL;
+ }
+ return handle;
+}
+
+//LLCore::HttpHandle LLAgent::httpGetCapibility(const std::string &cap, const LLURI &uri, LLHttpSDHandler *usrhndlr)
+//{
+//}
+
+
BOOL LLAgent::getAdminOverride() const
{
return mAgentAccess->getAdminOverride();
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 278e4c0fa1..6b636a2dc0 100755
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -63,6 +63,7 @@ class LLSLURL;
class LLPauseRequestHandle;
class LLUIColor;
class LLTeleportRequest;
+class LLHttpSDHandler;
typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;
@@ -919,6 +920,20 @@ public:
/********************************************************************************
** **
+ ** UTILITY
+ **/
+public:
+ /// Utilities for allowing the the agent sub managers to post and get via
+ /// HTTP using the agent's policy settings and headers.
+ LLCore::HttpHandle requestPostCapibility(const std::string &cap, const std::string &url, LLSD &postData, LLHttpSDHandler *usrhndlr = NULL);
+ //LLCore::HttpHandle httpGetCapibility(const std::string &cap, const LLURI &uri, LLHttpSDHandler *usrhndlr = NULL);
+
+/** Utility
+ ** **
+ *******************************************************************************/
+
+/********************************************************************************
+ ** **
** DEBUGGING
**/
diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp
index 8da78a45a6..cd9166f7b7 100755
--- a/indra/newview/llappcorehttp.cpp
+++ b/indra/newview/llappcorehttp.cpp
@@ -103,10 +103,10 @@ static const struct
"RenderMaterials",
"material manager requests"
},
- { // AP_AVATAR
+ { // AP_AGENT
2, 1, 32, 0, true,
- "Avatar",
- "Avatar requests"
+ "Agent",
+ "Agent requests"
}
};
diff --git a/indra/newview/llappcorehttp.h b/indra/newview/llappcorehttp.h
index 95b56100a6..410d7c6b07 100755
--- a/indra/newview/llappcorehttp.h
+++ b/indra/newview/llappcorehttp.h
@@ -185,7 +185,7 @@ public:
/// Concurrency: mid
/// Request rate: low
/// Pipelined: yes
- AP_AVATAR,
+ AP_AGENT,
AP_COUNT // Must be last
};
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index bb4228dbb2..ae758609ab 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -3442,6 +3442,7 @@ void LLAppearanceMgr::requestServerAppearanceUpdate()
llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion);
gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version;
+ // *TODO: use the unified call in LLAgent (?)
LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,
mHttpPolicy, mHttpPriority, url,
postData, mHttpOptions, mHttpHeaders, handler);
@@ -3778,7 +3779,7 @@ LLAppearanceMgr::LLAppearanceMgr():
mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest());
mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders(), false);
mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions(), false);
- mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_AVATAR);
+ mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_AGENT);
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();
// unlock outfit on save operation completed