summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/lluri.cpp111
1 files changed, 111 insertions, 0 deletions
diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp
index 18867a77e1..22526c9a03 100644
--- a/indra/llcommon/lluri.cpp
+++ b/indra/llcommon/lluri.cpp
@@ -299,6 +299,117 @@ LLURI LLURI::buildHTTP(const std::string& host,
return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path, query);
}
+namespace {
+ LLURI buildBackboneURL(LLApp* app,
+ const std::string& p1 = "",
+ const std::string& p2 = "",
+ const std::string& p3 = "")
+ {
+ std::string host = "localhost:12040";
+
+ if (app)
+ {
+ host = app->getOption("backbone-host-port").asString();
+ }
+
+ LLSD path = LLSD::emptyArray();
+ if (!p1.empty()) path.append(p1);
+ if (!p2.empty()) path.append(p2);
+ if (!p3.empty()) path.append(p3);
+
+ return LLURI::buildHTTP(host, path);
+ }
+}
+
+#if LL_ENABLE_JANKY_DEPRECATED_WEB_SERVICE_CALLS
+// static
+LLURI LLURI::buildBulkAgentNamesURI(LLApp* app)
+{
+ std::string host = "localhost:12040";
+
+ if (app)
+ {
+ host = app->getOption("backbone-host-port").asString();
+ }
+
+ LLSD path = LLSD::emptyArray();
+ path.append("agent");
+ path.append("names");
+
+ return buildHTTP(host, path);
+}
+
+// static
+LLURI LLURI::buildBulkAgentNamesURI(LLApp* app)
+{
+ std::string host = "localhost:12040";
+
+ if (app)
+ {
+ host = app->getOption("backbone-host-port").asString();
+ }
+
+ LLSD path = LLSD::emptyArray();
+ path.append("agent");
+ path.append("names");
+
+ return buildHTTP(host, path);
+}
+
+// static
+LLURI LLURI::buildAgentSessionURI(const LLUUID& agent_id, LLApp* app)
+{
+ return buildBackboneURL(app, "agent", agent_id.asString(), "session");
+}
+
+// static
+LLURI LLURI::buildAgentNameURI(const LLUUID& agent_id, LLApp* app)
+{
+ std::string host = "localhost:12040";
+
+ if (app)
+ {
+ host = app->getOption("backbone-host-port").asString();
+ }
+
+ LLSD path = LLSD::emptyArray();
+ path.append("agent");
+ path.append(agent_id);
+ path.append("name");
+
+ return buildHTTP(host, path);
+}
+
+// static
+LLURI LLURI::buildAgentNameURI(const LLUUID& agent_id, LLApp* app)
+{
+ std::string host = "localhost:12040";
+
+ if (app)
+ {
+ host = app->getOption("backbone-host-port").asString();
+ }
+
+ LLSD path = LLSD::emptyArray();
+ path.append("agent");
+ path.append(agent_id);
+ path.append("name");
+
+ return buildHTTP(host, path);
+}
+
+// static
+LLURI LLURI::buildAgentLoginInfoURI(const LLUUID& agent_id, const std::string& dataserver)
+{
+ LLSD path = LLSD::emptyArray();
+ path.append("agent");
+ path.append(agent_id);
+ path.append("logininfo");
+
+ return buildHTTP(dataserver, path);
+}
+#endif // LL_ENABLE_JANKY_DEPRECATED_WEB_SERVICE_CALLS
+
std::string LLURI::asString() const
{
if (mScheme.empty())