summaryrefslogtreecommitdiff
path: root/indra/llmessage/llservicebuilder.cpp
diff options
context:
space:
mode:
authorKelly Washington <kelly@lindenlab.com>2009-02-24 19:29:36 +0000
committerKelly Washington <kelly@lindenlab.com>2009-02-24 19:29:36 +0000
commitaa2b978bf59dd74083bec86c61a29fefb4ebb14c (patch)
tree63d0e55a524208eb2bdad1a1a6f0d03af1b39de2 /indra/llmessage/llservicebuilder.cpp
parentf5242719b628efb148f05ba44ce78f9818ec617a (diff)
merge -r 112783:112799 linden/branches/kelly/lsl-http-in-merge to linden/trunk
Diffstat (limited to 'indra/llmessage/llservicebuilder.cpp')
-rw-r--r--indra/llmessage/llservicebuilder.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/llmessage/llservicebuilder.cpp b/indra/llmessage/llservicebuilder.cpp
index dcce00c138..3f07147ebc 100644
--- a/indra/llmessage/llservicebuilder.cpp
+++ b/indra/llmessage/llservicebuilder.cpp
@@ -86,6 +86,14 @@ void LLServiceBuilder::createServiceDefinition(
}
}
+static
+bool starts_with(const std::string& text, const char* prefix)
+{
+ return text.substr(0, strlen(prefix)) == prefix;
+}
+
+// TODO: Build a real services.xml for windows development.
+// and remove the base_url logic below.
std::string LLServiceBuilder::buildServiceURI(const std::string& service_name)
{
std::ostringstream service_url;
@@ -96,7 +104,19 @@ std::string LLServiceBuilder::buildServiceURI(const std::string& service_name)
LLApp* app = LLApp::instance();
if(app)
{
- LLSD base_url = app->getOption("services-base-url");
+ // We define a base-url for some development configurations
+ // In production neither of these are defined and all services have full urls
+ LLSD base_url;
+
+ if (starts_with(service_name,"cap"))
+ {
+ base_url = app->getOption("cap-base-url");
+ }
+
+ if (base_url.asString().empty())
+ {
+ base_url = app->getOption("services-base-url");
+ }
service_url << base_url.asString();
}
service_url << mServiceMap[service_name];