aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Scripting
diff options
context:
space:
mode:
authorMelanie2013-02-27 18:05:04 +0000
committerMelanie2013-02-27 18:05:04 +0000
commit578174d21c82e7249016e31f0c63215e67f92f17 (patch)
treec9c970d2ce4836dcf894922172d784d16cbc2837 /OpenSim/Region/CoreModules/Scripting
parentMerge branch 'master' into careminster (diff)
parentImprove description of GenerateMapTiles config option (diff)
downloadopensim-SC-578174d21c82e7249016e31f0c63215e67f92f17.zip
opensim-SC-578174d21c82e7249016e31f0c63215e67f92f17.tar.gz
opensim-SC-578174d21c82e7249016e31f0c63215e67f92f17.tar.bz2
opensim-SC-578174d21c82e7249016e31f0c63215e67f92f17.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs38
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs16
2 files changed, 31 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index 60b7190..b9c373b 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -88,15 +88,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
88 /// </summary> 88 /// </summary>
89 private int m_TotalUrls = 15000; 89 private int m_TotalUrls = 15000;
90 90
91 private uint https_port = 0; 91 private uint m_HttpsPort = 0;
92 private IHttpServer m_HttpServer = null; 92 private IHttpServer m_HttpServer = null;
93 private IHttpServer m_HttpsServer = null; 93 private IHttpServer m_HttpsServer = null;
94 94
95 private string m_ExternalHostNameForLSL = ""; 95 public string ExternalHostNameForLSL { get; private set; }
96 public string ExternalHostNameForLSL
97 {
98 get { return m_ExternalHostNameForLSL; }
99 }
100 96
101 public Type ReplaceableInterface 97 public Type ReplaceableInterface
102 { 98 {
@@ -110,13 +106,21 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
110 106
111 public void Initialise(IConfigSource config) 107 public void Initialise(IConfigSource config)
112 { 108 {
113 m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName); 109 IConfig networkConfig = config.Configs["Network"];
114 bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener",false); 110
115 if (ssl_enabled) 111 if (networkConfig != null)
116 { 112 {
117 https_port = (uint) config.Configs["Network"].GetInt("https_port",0); 113 ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", null);
114
115 bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener", false);
116
117 if (ssl_enabled)
118 m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort);
118 } 119 }
119 120
121 if (ExternalHostNameForLSL == null)
122 ExternalHostNameForLSL = System.Environment.MachineName;
123
120 IConfig llFunctionsConfig = config.Configs["LL-Functions"]; 124 IConfig llFunctionsConfig = config.Configs["LL-Functions"];
121 125
122 if (llFunctionsConfig != null) 126 if (llFunctionsConfig != null)
@@ -136,9 +140,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
136 m_HttpServer = MainServer.Instance; 140 m_HttpServer = MainServer.Instance;
137 // 141 //
138 // We can use the https if it is enabled 142 // We can use the https if it is enabled
139 if (https_port > 0) 143 if (m_HttpsPort > 0)
140 { 144 {
141 m_HttpsServer = MainServer.GetHttpServer(https_port); 145 m_HttpsServer = MainServer.GetHttpServer(m_HttpsPort);
142 } 146 }
143 } 147 }
144 148
@@ -176,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
176 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 180 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
177 return urlcode; 181 return urlcode;
178 } 182 }
179 string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString(); 183 string url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString();
180 184
181 UrlData urlData = new UrlData(); 185 UrlData urlData = new UrlData();
182 urlData.hostID = host.UUID; 186 urlData.hostID = host.UUID;
@@ -221,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
221 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 225 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
222 return urlcode; 226 return urlcode;
223 } 227 }
224 string url = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString(); 228 string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString();
225 229
226 UrlData urlData = new UrlData(); 230 UrlData urlData = new UrlData();
227 urlData.hostID = host.UUID; 231 urlData.hostID = host.UUID;
@@ -542,7 +546,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
542 { 546 {
543 Hashtable headers = (Hashtable)request["headers"]; 547 Hashtable headers = (Hashtable)request["headers"];
544 548
545// string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; 549// string uri_full = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/";
546 550
547 int pos1 = uri.IndexOf("/");// /lslhttp 551 int pos1 = uri.IndexOf("/");// /lslhttp
548 int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/ 552 int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
@@ -558,10 +562,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
558 UrlData url = null; 562 UrlData url = null;
559 string urlkey; 563 string urlkey;
560 if (!is_ssl) 564 if (!is_ssl)
561 urlkey = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp; 565 urlkey = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp;
562 //m_UrlMap[]; 566 //m_UrlMap[];
563 else 567 else
564 urlkey = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp; 568 urlkey = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp;
565 569
566 if (m_UrlMap.ContainsKey(urlkey)) 570 if (m_UrlMap.ContainsKey(urlkey))
567 { 571 {
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index f395441..14304a7 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
@@ -838,13 +838,17 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
838 try 838 try
839 { 839 {
840 WebRequest request = HttpWebRequest.Create(url); 840 WebRequest request = HttpWebRequest.Create(url);
841//Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. 841
842//Ckrinke Stream str = null; 842 using (HttpWebResponse response = (HttpWebResponse)(request).GetResponse())
843 HttpWebResponse response = (HttpWebResponse)(request).GetResponse();
844 if (response.StatusCode == HttpStatusCode.OK)
845 { 843 {
846 Bitmap image = new Bitmap(response.GetResponseStream()); 844 if (response.StatusCode == HttpStatusCode.OK)
847 return image; 845 {
846 using (Stream s = response.GetResponseStream())
847 {
848 Bitmap image = new Bitmap(s);
849 return image;
850 }
851 }
848 } 852 }
849 } 853 }
850 catch { } 854 catch { }