aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llservicebuilder.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llmessage/llservicebuilder.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/llmessage/llservicebuilder.cpp')
-rw-r--r--linden/indra/llmessage/llservicebuilder.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/linden/indra/llmessage/llservicebuilder.cpp b/linden/indra/llmessage/llservicebuilder.cpp
index 39f2f85..3f07147 100644
--- a/linden/indra/llmessage/llservicebuilder.cpp
+++ b/linden/indra/llmessage/llservicebuilder.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -85,6 +86,14 @@ void LLServiceBuilder::createServiceDefinition(
85 } 86 }
86} 87}
87 88
89static
90bool starts_with(const std::string& text, const char* prefix)
91{
92 return text.substr(0, strlen(prefix)) == prefix;
93}
94
95// TODO: Build a real services.xml for windows development.
96// and remove the base_url logic below.
88std::string LLServiceBuilder::buildServiceURI(const std::string& service_name) 97std::string LLServiceBuilder::buildServiceURI(const std::string& service_name)
89{ 98{
90 std::ostringstream service_url; 99 std::ostringstream service_url;
@@ -95,7 +104,19 @@ std::string LLServiceBuilder::buildServiceURI(const std::string& service_name)
95 LLApp* app = LLApp::instance(); 104 LLApp* app = LLApp::instance();
96 if(app) 105 if(app)
97 { 106 {
98 LLSD base_url = app->getOption("services-base-url"); 107 // We define a base-url for some development configurations
108 // In production neither of these are defined and all services have full urls
109 LLSD base_url;
110
111 if (starts_with(service_name,"cap"))
112 {
113 base_url = app->getOption("cap-base-url");
114 }
115
116 if (base_url.asString().empty())
117 {
118 base_url = app->getOption("services-base-url");
119 }
99 service_url << base_url.asString(); 120 service_url << base_url.asString();
100 } 121 }
101 service_url << mServiceMap[service_name]; 122 service_url << mServiceMap[service_name];