aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Scripting
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-06 21:56:50 +0000
committerJustin Clarke Casey2009-02-06 21:56:50 +0000
commita6b21a3b83d471eabacb92c9c2d9a575e4824d5d (patch)
treeff2266f170c210499ab45030ff6c9ad55c98ae96 /OpenSim/Region/Environment/Modules/Scripting
parent* Removed superflous (and circular) ref to OpenSim.Region.Framework (diff)
downloadopensim-SC_OLD-a6b21a3b83d471eabacb92c9c2d9a575e4824d5d.zip
opensim-SC_OLD-a6b21a3b83d471eabacb92c9c2d9a575e4824d5d.tar.gz
opensim-SC_OLD-a6b21a3b83d471eabacb92c9c2d9a575e4824d5d.tar.bz2
opensim-SC_OLD-a6b21a3b83d471eabacb92c9c2d9a575e4824d5d.tar.xz
* minor: Apply second patch from http://opensimulator.org/mantis/view.php?id=3089
* This adds more explanation for the new proxy settings in OpenSim.ini.example * Also does some formatting correction * I did some additional reformatting on top of that
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting')
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs33
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs32
2 files changed, 37 insertions, 28 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 821c60e..faa6f3c 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -90,8 +90,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
90 private int httpTimeout = 30000; 90 private int httpTimeout = 30000;
91 private string m_name = "HttpScriptRequests"; 91 private string m_name = "HttpScriptRequests";
92 92
93 private string m_proxyurl = ""; 93 private string m_proxyurl = "";
94 private string m_proxyexcepts = ""; 94 private string m_proxyexcepts = "";
95 95
96 // <request id, HttpRequestClass> 96 // <request id, HttpRequestClass>
97 private Dictionary<UUID, HttpRequestClass> m_pendingRequests; 97 private Dictionary<UUID, HttpRequestClass> m_pendingRequests;
@@ -155,8 +155,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
155 htc.HttpTimeout = httpTimeout; 155 htc.HttpTimeout = httpTimeout;
156 htc.OutboundBody = body; 156 htc.OutboundBody = body;
157 htc.ResponseHeaders = headers; 157 htc.ResponseHeaders = headers;
158 htc.proxyurl = m_proxyurl; 158 htc.proxyurl = m_proxyurl;
159 htc.proxyexcepts = m_proxyexcepts; 159 htc.proxyexcepts = m_proxyexcepts;
160 160
161 lock (HttpListLock) 161 lock (HttpListLock)
162 { 162 {
@@ -344,21 +344,26 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
344 Request = (HttpWebRequest) WebRequest.Create(Url); 344 Request = (HttpWebRequest) WebRequest.Create(Url);
345 Request.Method = HttpMethod; 345 Request.Method = HttpMethod;
346 Request.ContentType = HttpMIMEType; 346 Request.ContentType = HttpMIMEType;
347 if (proxyurl.Length > 0) 347
348 { 348 if (proxyurl != null && proxyurl.Length > 0)
349 if (proxyexcepts.Length > 0) { 349 {
350 string[] elist = proxyexcepts.Split(';'); 350 if (proxyexcepts != null && proxyexcepts.Length > 0)
351 Request.Proxy = new WebProxy(proxyurl,true,elist); 351 {
352 } else { 352 string[] elist = proxyexcepts.Split(';');
353 Request.Proxy = new WebProxy(proxyurl,true); 353 Request.Proxy = new WebProxy(proxyurl, true, elist);
354 } 354 }
355 } 355 else
356 {
357 Request.Proxy = new WebProxy(proxyurl, true);
358 }
359 }
356 360
357 foreach (KeyValuePair<string, string> entry in ResponseHeaders) 361 foreach (KeyValuePair<string, string> entry in ResponseHeaders)
358 Request.Headers[entry.Key] = entry.Value; 362 Request.Headers[entry.Key] = entry.Value;
359 363
360 // Encode outbound data 364 // Encode outbound data
361 if (OutboundBody.Length > 0) { 365 if (OutboundBody.Length > 0)
366 {
362 byte[] data = Encoding.UTF8.GetBytes(OutboundBody); 367 byte[] data = Encoding.UTF8.GetBytes(OutboundBody);
363 368
364 Request.ContentLength = data.Length; 369 Request.ContentLength = data.Length;
diff --git a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs
index af78c36..0112ee6 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs
@@ -43,9 +43,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL
43 private Scene m_scene; 43 private Scene m_scene;
44 private IDynamicTextureManager m_textureManager; 44 private IDynamicTextureManager m_textureManager;
45 45
46 private string m_proxyurl = ""; 46 private string m_proxyurl = "";
47 private string m_proxyexcepts = ""; 47 private string m_proxyexcepts = "";
48
49 48
50 #region IDynamicTextureRender Members 49 #region IDynamicTextureRender Members
51 50
@@ -95,8 +94,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL
95 { 94 {
96 m_scene = scene; 95 m_scene = scene;
97 } 96 }
98 m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); 97
99 m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); 98 m_proxyurl = config.Configs["Startup"].GetString("HttpProxy");
99 m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions");
100 } 100 }
101 101
102 public void PostInitialise() 102 public void PostInitialise()
@@ -127,15 +127,19 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL
127 private void MakeHttpRequest(string url, UUID requestID) 127 private void MakeHttpRequest(string url, UUID requestID)
128 { 128 {
129 WebRequest request = HttpWebRequest.Create(url); 129 WebRequest request = HttpWebRequest.Create(url);
130 if (m_proxyurl.Length > 0) 130
131 { 131 if (m_proxyurl != null && m_proxyurl.Length > 0)
132 if (m_proxyexcepts.Length > 0) { 132 {
133 string[] elist = m_proxyexcepts.Split(';'); 133 if (m_proxyexcepts != null && m_proxyexcepts.Length > 0)
134 request.Proxy = new WebProxy(m_proxyurl,true,elist); 134 {
135 } else { 135 string[] elist = m_proxyexcepts.Split(';');
136 request.Proxy = new WebProxy(m_proxyurl,true); 136 request.Proxy = new WebProxy(m_proxyurl, true, elist);
137 } 137 }
138 } 138 else
139 {
140 request.Proxy = new WebProxy(m_proxyurl, true);
141 }
142 }
139 143
140 RequestState state = new RequestState((HttpWebRequest) request, requestID); 144 RequestState state = new RequestState((HttpWebRequest) request, requestID);
141 // IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); 145 // IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state);