aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs484
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs83
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs10
3 files changed, 306 insertions, 271 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index 2d81e4c..8b7a878 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -54,12 +54,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
54 { 54 {
55 public UUID requestID; 55 public UUID requestID;
56 public Dictionary<string, string> headers; 56 public Dictionary<string, string> headers;
57 public string body; 57 public string body;
58 public int responseCode; 58 public int responseCode;
59 public string responseBody; 59 public string responseBody;
60 public ManualResetEvent ev; 60 public ManualResetEvent ev;
61 public bool requestDone; 61 public bool requestDone;
62 public int startTime; 62 public int startTime;
63 public string uri; 63 public string uri;
64 } 64 }
65 65
@@ -73,23 +73,23 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
73 new Dictionary<UUID, UrlData>(); 73 new Dictionary<UUID, UrlData>();
74 74
75 private Dictionary<string, UrlData> m_UrlMap = 75 private Dictionary<string, UrlData> m_UrlMap =
76 new Dictionary<string, UrlData>(); 76 new Dictionary<string, UrlData>();
77 77
78 78
79 private int m_TotalUrls = 100; 79 private int m_TotalUrls = 100;
80 80
81 private IHttpServer m_HttpServer = null; 81 private IHttpServer m_HttpServer = null;
82 82
83 private string m_ExternalHostNameForLSL = ""; 83 private string m_ExternalHostNameForLSL = "";
84 84
85 public Type ReplaceableInterface 85 public Type ReplaceableInterface
86 { 86 {
87 get { return null; } 87 get { return null; }
88 } 88 }
89 89
90 private Hashtable HandleHttpPoll(Hashtable request) 90 private Hashtable HandleHttpPoll(Hashtable request)
91 { 91 {
92 return new Hashtable(); 92 return new Hashtable();
93 } 93 }
94 94
95 public string Name 95 public string Name
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
98 } 98 }
99 99
100 public void Initialise(IConfigSource config) 100 public void Initialise(IConfigSource config)
101 { 101 {
102 m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName); 102 m_ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", System.Environment.MachineName);
103 } 103 }
104 104
@@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
130 130
131 public void Close() 131 public void Close()
132 { 132 {
133 } 133 }
134 public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID) 134 public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
135 { 135 {
136 UUID urlcode = UUID.Random(); 136 UUID urlcode = UUID.Random();
@@ -141,8 +141,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
141 { 141 {
142 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); 142 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
143 return urlcode; 143 return urlcode;
144 } 144 }
145 string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/"; 145 string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
146 146
147 UrlData urlData = new UrlData(); 147 UrlData urlData = new UrlData();
148 urlData.hostID = host.UUID; 148 urlData.hostID = host.UUID;
@@ -152,14 +152,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
152 urlData.urlcode = urlcode; 152 urlData.urlcode = urlcode;
153 urlData.requests = new Dictionary<UUID, RequestData>(); 153 urlData.requests = new Dictionary<UUID, RequestData>();
154 154
155 155
156 m_UrlMap[url] = urlData; 156 m_UrlMap[url] = urlData;
157 157
158 string uri = "/lslhttp/" + urlcode.ToString() + "/"; 158 string uri = "/lslhttp/" + urlcode.ToString() + "/";
159 159
160 m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, 160 m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll,
161 new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, 161 new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents,
162 urlcode)); 162 urlcode));
163 163
164 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); 164 engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
165 } 165 }
@@ -180,11 +180,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
180 { 180 {
181 lock (m_UrlMap) 181 lock (m_UrlMap)
182 { 182 {
183 UrlData data; 183 UrlData data;
184 184
185 if (!m_UrlMap.TryGetValue(url, out data)) 185 if (!m_UrlMap.TryGetValue(url, out data))
186 { 186 {
187 return; 187 return;
188 } 188 }
189 189
190 foreach (UUID req in data.requests.Keys) 190 foreach (UUID req in data.requests.Keys)
@@ -196,36 +196,36 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
196 } 196 }
197 197
198 public void HttpResponse(UUID request, int status, string body) 198 public void HttpResponse(UUID request, int status, string body)
199 { 199 {
200 if (m_RequestMap.ContainsKey(request)) 200 if (m_RequestMap.ContainsKey(request))
201 { 201 {
202 UrlData urlData = m_RequestMap[request]; 202 UrlData urlData = m_RequestMap[request];
203 RequestData requestData=urlData.requests[request]; 203 RequestData requestData=urlData.requests[request];
204 urlData.requests[request].responseCode = status; 204 urlData.requests[request].responseCode = status;
205 urlData.requests[request].responseBody = body; 205 urlData.requests[request].responseBody = body;
206 //urlData.requests[request].ev.Set(); 206 //urlData.requests[request].ev.Set();
207 urlData.requests[request].requestDone=true; 207 urlData.requests[request].requestDone=true;
208 } 208 }
209 else 209 else
210 { 210 {
211 m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString()); 211 m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
212 } 212 }
213 } 213 }
214 214
215 public string GetHttpHeader(UUID requestId, string header) 215 public string GetHttpHeader(UUID requestId, string header)
216 { 216 {
217 if (m_RequestMap.ContainsKey(requestId)) 217 if (m_RequestMap.ContainsKey(requestId))
218 { 218 {
219 UrlData urlData=m_RequestMap[requestId]; 219 UrlData urlData=m_RequestMap[requestId];
220 string value; 220 string value;
221 if (urlData.requests[requestId].headers.TryGetValue(header,out value)) 221 if (urlData.requests[requestId].headers.TryGetValue(header,out value))
222 return value; 222 return value;
223 } 223 }
224 else 224 else
225 { 225 {
226 m_log.Warn("[HttpRequestHandler] There was no http-in request with id " + requestId); 226 m_log.Warn("[HttpRequestHandler] There was no http-in request with id " + requestId);
227 } 227 }
228 return String.Empty; 228 return String.Empty;
229 } 229 }
230 230
231 public int GetFreeUrls() 231 public int GetFreeUrls()
@@ -275,63 +275,63 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
275 foreach (string urlname in removeURLs) 275 foreach (string urlname in removeURLs)
276 m_UrlMap.Remove(urlname); 276 m_UrlMap.Remove(urlname);
277 } 277 }
278 } 278 }
279 279
280 280
281 private void RemoveUrl(UrlData data) 281 private void RemoveUrl(UrlData data)
282 { 282 {
283 m_HttpServer.RemoveHTTPHandler("", "/lslhttp/"+data.urlcode.ToString()+"/"); 283 m_HttpServer.RemoveHTTPHandler("", "/lslhttp/"+data.urlcode.ToString()+"/");
284 } 284 }
285 285
286 private Hashtable NoEvents(UUID requestID, UUID sessionID) 286 private Hashtable NoEvents(UUID requestID, UUID sessionID)
287 { 287 {
288 Hashtable response = new Hashtable(); 288 Hashtable response = new Hashtable();
289 UrlData url; 289 UrlData url;
290 lock (m_RequestMap) 290 lock (m_RequestMap)
291 { 291 {
292 if (!m_RequestMap.ContainsKey(requestID)) 292 if (!m_RequestMap.ContainsKey(requestID))
293 return response; 293 return response;
294 url = m_RequestMap[requestID]; 294 url = m_RequestMap[requestID];
295 } 295 }
296 296
297 if (System.Environment.TickCount - url.requests[requestID].startTime > 25000) 297 if (System.Environment.TickCount - url.requests[requestID].startTime > 25000)
298 { 298 {
299 response["int_response_code"] = 500; 299 response["int_response_code"] = 500;
300 response["str_response_string"] = "Script timeout"; 300 response["str_response_string"] = "Script timeout";
301 response["content_type"] = "text/plain"; 301 response["content_type"] = "text/plain";
302 response["keepalive"] = false; 302 response["keepalive"] = false;
303 response["reusecontext"] = false; 303 response["reusecontext"] = false;
304 304
305 //remove from map 305 //remove from map
306 lock (url) 306 lock (url)
307 { 307 {
308 url.requests.Remove(requestID); 308 url.requests.Remove(requestID);
309 m_RequestMap.Remove(requestID); 309 m_RequestMap.Remove(requestID);
310 } 310 }
311 311
312 return response; 312 return response;
313 } 313 }
314 314
315 315
316 return response; 316 return response;
317 } 317 }
318 318
319 private bool HasEvents(UUID requestID, UUID sessionID) 319 private bool HasEvents(UUID requestID, UUID sessionID)
320 { 320 {
321 UrlData url=null; 321 UrlData url=null;
322 322
323 lock (m_RequestMap) 323 lock (m_RequestMap)
324 { 324 {
325 if (!m_RequestMap.ContainsKey(requestID)) 325 if (!m_RequestMap.ContainsKey(requestID))
326 { 326 {
327 return false; 327 return false;
328 }
329 url = m_RequestMap[requestID];
330 if (!url.requests.ContainsKey(requestID))
331 {
332 return false;
333 } 328 }
334 } 329 url = m_RequestMap[requestID];
330 if (!url.requests.ContainsKey(requestID))
331 {
332 return false;
333 }
334 }
335 335
336 if (System.Environment.TickCount-url.requests[requestID].startTime>25000) 336 if (System.Environment.TickCount-url.requests[requestID].startTime>25000)
337 { 337 {
@@ -343,146 +343,146 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
343 else 343 else
344 return false; 344 return false;
345 345
346 } 346 }
347 private Hashtable GetEvents(UUID requestID, UUID sessionID, string request) 347 private Hashtable GetEvents(UUID requestID, UUID sessionID, string request)
348 { 348 {
349 UrlData url = null; 349 UrlData url = null;
350 RequestData requestData = null; 350 RequestData requestData = null;
351 351
352 lock (m_RequestMap) 352 lock (m_RequestMap)
353 { 353 {
354 if (!m_RequestMap.ContainsKey(requestID)) 354 if (!m_RequestMap.ContainsKey(requestID))
355 return NoEvents(requestID,sessionID); 355 return NoEvents(requestID,sessionID);
356 url = m_RequestMap[requestID]; 356 url = m_RequestMap[requestID];
357 requestData = url.requests[requestID]; 357 requestData = url.requests[requestID];
358 } 358 }
359 359
360 if (!requestData.requestDone) 360 if (!requestData.requestDone)
361 return NoEvents(requestID,sessionID); 361 return NoEvents(requestID,sessionID);
362 362
363 Hashtable response = new Hashtable(); 363 Hashtable response = new Hashtable();
364 364
365 if (System.Environment.TickCount - requestData.startTime > 25000) 365 if (System.Environment.TickCount - requestData.startTime > 25000)
366 { 366 {
367 response["int_response_code"] = 500; 367 response["int_response_code"] = 500;
368 response["str_response_string"] = "Script timeout"; 368 response["str_response_string"] = "Script timeout";
369 response["content_type"] = "text/plain"; 369 response["content_type"] = "text/plain";
370 response["keepalive"] = false; 370 response["keepalive"] = false;
371 response["reusecontext"] = false; 371 response["reusecontext"] = false;
372 return response; 372 return response;
373 } 373 }
374 //put response 374 //put response
375 response["int_response_code"] = requestData.responseCode; 375 response["int_response_code"] = requestData.responseCode;
376 response["str_response_string"] = requestData.responseBody; 376 response["str_response_string"] = requestData.responseBody;
377 response["content_type"] = "text/plain"; 377 response["content_type"] = "text/plain";
378 response["keepalive"] = false; 378 response["keepalive"] = false;
379 response["reusecontext"] = false; 379 response["reusecontext"] = false;
380 380
381 //remove from map 381 //remove from map
382 lock (url) 382 lock (url)
383 { 383 {
384 url.requests.Remove(requestID); 384 url.requests.Remove(requestID);
385 m_RequestMap.Remove(requestID); 385 m_RequestMap.Remove(requestID);
386 } 386 }
387 387
388 return response; 388 return response;
389 } 389 }
390 public void HttpRequestHandler(UUID requestID, Hashtable request) 390 public void HttpRequestHandler(UUID requestID, Hashtable request)
391 { 391 {
392 lock (request) 392 lock (request)
393 { 393 {
394 string uri = request["uri"].ToString(); 394 string uri = request["uri"].ToString();
395 395
396 try 396 try
397 { 397 {
398 Hashtable headers = (Hashtable)request["headers"]; 398 Hashtable headers = (Hashtable)request["headers"];
399 399
400 string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/"; 400 string uri_full = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/";
401 401
402 int pos1 = uri.IndexOf("/");// /lslhttp 402 int pos1 = uri.IndexOf("/");// /lslhttp
403 int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/ 403 int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
404 int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/ 404 int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/
405 string uri_tmp = uri.Substring(0, pos3 + 1); 405 string uri_tmp = uri.Substring(0, pos3 + 1);
406 //HTTP server code doesn't provide us with QueryStrings 406 //HTTP server code doesn't provide us with QueryStrings
407 string pathInfo; 407 string pathInfo;
408 string queryString; 408 string queryString;
409 queryString = ""; 409 queryString = "";
410 410
411 pathInfo = uri.Substring(pos3); 411 pathInfo = uri.Substring(pos3);
412 412
413 UrlData url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp]; 413 UrlData url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp];
414 414
415 //for llGetHttpHeader support we need to store original URI here 415 //for llGetHttpHeader support we need to store original URI here
416 //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers 416 //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers
417 //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader 417 //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader
418 418
419 RequestData requestData = new RequestData(); 419 RequestData requestData = new RequestData();
420 requestData.requestID = requestID; 420 requestData.requestID = requestID;
421 requestData.requestDone = false; 421 requestData.requestDone = false;
422 requestData.startTime = System.Environment.TickCount; 422 requestData.startTime = System.Environment.TickCount;
423 requestData.uri = uri; 423 requestData.uri = uri;
424 if (requestData.headers == null) 424 if (requestData.headers == null)
425 requestData.headers = new Dictionary<string, string>(); 425 requestData.headers = new Dictionary<string, string>();
426 426
427 foreach (DictionaryEntry header in headers) 427 foreach (DictionaryEntry header in headers)
428 { 428 {
429 string key = (string)header.Key; 429 string key = (string)header.Key;
430 string value = (string)header.Value; 430 string value = (string)header.Value;
431 requestData.headers.Add(key, value); 431 requestData.headers.Add(key, value);
432 } 432 }
433 foreach (DictionaryEntry de in request) 433 foreach (DictionaryEntry de in request)
434 { 434 {
435 if (de.Key.ToString() == "querystringkeys") 435 if (de.Key.ToString() == "querystringkeys")
436 { 436 {
437 System.String[] keys = (System.String[])de.Value; 437 System.String[] keys = (System.String[])de.Value;
438 foreach (String key in keys) 438 foreach (String key in keys)
439 { 439 {
440 if (request.ContainsKey(key)) 440 if (request.ContainsKey(key))
441 { 441 {
442 string val = (String)request[key]; 442 string val = (String)request[key];
443 queryString = queryString + key + "=" + val + "&"; 443 queryString = queryString + key + "=" + val + "&";
444 } 444 }
445 } 445 }
446 if (queryString.Length > 1) 446 if (queryString.Length > 1)
447 queryString = queryString.Substring(0, queryString.Length - 1); 447 queryString = queryString.Substring(0, queryString.Length - 1);
448 448
449 } 449 }
450 450
451 } 451 }
452 452
453 //if this machine is behind DNAT/port forwarding, currently this is being 453 //if this machine is behind DNAT/port forwarding, currently this is being
454 //set to address of port forwarding router 454 //set to address of port forwarding router
455 requestData.headers["x-remote-ip"] = requestData.headers["remote_addr"]; 455 requestData.headers["x-remote-ip"] = requestData.headers["remote_addr"];
456 requestData.headers["x-path-info"] = pathInfo; 456 requestData.headers["x-path-info"] = pathInfo;
457 requestData.headers["x-query-string"] = queryString; 457 requestData.headers["x-query-string"] = queryString;
458 requestData.headers["x-script-url"] = url.url; 458 requestData.headers["x-script-url"] = url.url;
459 459
460 requestData.ev = new ManualResetEvent(false); 460 requestData.ev = new ManualResetEvent(false);
461 lock (url.requests) 461 lock (url.requests)
462 { 462 {
463 url.requests.Add(requestID, requestData); 463 url.requests.Add(requestID, requestData);
464 } 464 }
465 lock (m_RequestMap) 465 lock (m_RequestMap)
466 { 466 {
467 //add to request map 467 //add to request map
468 m_RequestMap.Add(requestID, url); 468 m_RequestMap.Add(requestID, url);
469 } 469 }
470 470
471 url.engine.PostScriptEvent(url.itemID, "http_request", new Object[] { requestID.ToString(), request["http-method"].ToString(), request["body"].ToString() }); 471 url.engine.PostScriptEvent(url.itemID, "http_request", new Object[] { requestID.ToString(), request["http-method"].ToString(), request["body"].ToString() });
472 472
473 //send initial response? 473 //send initial response?
474 Hashtable response = new Hashtable(); 474 Hashtable response = new Hashtable();
475 475
476 return; 476 return;
477 477
478 } 478 }
479 catch (Exception we) 479 catch (Exception we)
480 { 480 {
481 //Hashtable response = new Hashtable(); 481 //Hashtable response = new Hashtable();
482 m_log.Warn("[HttpRequestHandler]: http-in request failed"); 482 m_log.Warn("[HttpRequestHandler]: http-in request failed");
483 m_log.Warn(we.Message); 483 m_log.Warn(we.Message);
484 m_log.Warn(we.StackTrace); 484 m_log.Warn(we.StackTrace);
485 } 485 }
486 } 486 }
487 } 487 }
488 488
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
index b7e3213..e3cb05c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -63,6 +63,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
63 // This is key-ed on agent ID 63 // This is key-ed on agent ID
64 protected Dictionary<UUID, SimpleRegionInfo> m_knownRegions = new Dictionary<UUID, SimpleRegionInfo>(); 64 protected Dictionary<UUID, SimpleRegionInfo> m_knownRegions = new Dictionary<UUID, SimpleRegionInfo>();
65 65
66 protected Dictionary<UUID, ulong> m_HyperlinkHandles = new Dictionary<UUID, ulong>();
67
66 #region ISharedRegionModule 68 #region ISharedRegionModule
67 69
68 public Type ReplaceableInterface 70 public Type ReplaceableInterface
@@ -160,10 +162,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
160 if (regionInfo.RegionID.Equals(UUID.Zero)) 162 if (regionInfo.RegionID.Equals(UUID.Zero))
161 { 163 {
162 m_log.Info("[HGrid]: Linking remote region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort); 164 m_log.Info("[HGrid]: Linking remote region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort);
163 regionInfo.RegionID = m_HypergridServiceConnector.LinkRegion(regionInfo); 165 ulong regionHandle = 0;
166 regionInfo.RegionID = m_HypergridServiceConnector.LinkRegion(regionInfo, out regionHandle);
164 if (!regionInfo.RegionID.Equals(UUID.Zero)) 167 if (!regionInfo.RegionID.Equals(UUID.Zero))
165 { 168 {
166 m_HyperlinkRegions.Add(regionInfo.RegionID, regionInfo); 169 AddHyperlinkRegion(regionInfo, regionHandle);
167 m_log.Info("[HGrid]: Successfully linked to region_uuid " + regionInfo.RegionID); 170 m_log.Info("[HGrid]: Successfully linked to region_uuid " + regionInfo.RegionID);
168 171
169 // Try get the map image 172 // Try get the map image
@@ -186,15 +189,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
186 // Try the hyperlink collection 189 // Try the hyperlink collection
187 if (m_HyperlinkRegions.ContainsKey(regionID)) 190 if (m_HyperlinkRegions.ContainsKey(regionID))
188 { 191 {
189 m_HyperlinkRegions.Remove(regionID); 192 RemoveHyperlinkRegion(regionID);
190 return true; 193 return true;
191 } 194 }
192 // Try the foreign users home collection 195 // Try the foreign users home collection
193 if (m_knownRegions.ContainsKey(regionID)) 196
194 { 197 foreach (SimpleRegionInfo r in m_knownRegions.Values)
195 m_knownRegions.Remove(regionID); 198 if (r.RegionID == regionID)
196 return true; 199 {
197 } 200 RemoveHyperlinkHomeRegion(regionID);
201 return true;
202 }
203
198 // Finally, try the normal route 204 // Finally, try the normal route
199 return m_GridServiceConnector.DeregisterRegion(regionID); 205 return m_GridServiceConnector.DeregisterRegion(regionID);
200 } 206 }
@@ -213,8 +219,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
213 return m_HyperlinkRegions[regionID]; 219 return m_HyperlinkRegions[regionID];
214 220
215 // Try the foreign users home collection 221 // Try the foreign users home collection
216 if (m_knownRegions.ContainsKey(regionID)) 222 foreach (SimpleRegionInfo r in m_knownRegions.Values)
217 return m_knownRegions[regionID]; 223 if (r.RegionID == regionID)
224 return m_knownRegions[regionID];
218 225
219 // Finally, try the normal route 226 // Finally, try the normal route
220 return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); 227 return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID);
@@ -249,20 +256,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
249 if (region != null) 256 if (region != null)
250 return region; 257 return region;
251 258
252 // !!! Commenting until region name exists 259 // Try the hyperlink collection
253 //// Try the hyperlink collection 260 foreach (SimpleRegionInfo r in m_HyperlinkRegions.Values)
254 //foreach (SimpleRegionInfo r in m_HyperlinkRegions.Values) 261 {
255 //{ 262 if (r.RegionName == regionName)
256 // if (r.RegionName == regionName) 263 return r;
257 // return r; 264 }
258 //} 265
259 266 // Try the foreign users home collection
260 //// Try the foreign users home collection 267 foreach (SimpleRegionInfo r in m_knownRegions.Values)
261 //foreach (SimpleRegionInfo r in m_knownRegions.Values) 268 {
262 //{ 269 if (r.RegionName == regionName)
263 // if (r.RegionName == regionName) 270 return r;
264 // return r; 271 }
265 //}
266 return null; 272 return null;
267 } 273 }
268 274
@@ -299,6 +305,35 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
299 305
300 #endregion 306 #endregion
301 307
308 private void AddHyperlinkRegion(SimpleRegionInfo regionInfo, ulong regionHandle)
309 {
310 m_HyperlinkRegions.Add(regionInfo.RegionID, regionInfo);
311 m_HyperlinkHandles.Add(regionInfo.RegionID, regionHandle);
312 }
313
314 private void RemoveHyperlinkRegion(UUID regionID)
315 {
316 m_HyperlinkRegions.Remove(regionID);
317 m_HyperlinkHandles.Remove(regionID);
318 }
319
320 private void AddHyperlinkHomeRegion(UUID userID, SimpleRegionInfo regionInfo, ulong regionHandle)
321 {
322 m_knownRegions.Add(userID, regionInfo);
323 m_HyperlinkHandles.Add(regionInfo.RegionID, regionHandle);
324 }
325
326 private void RemoveHyperlinkHomeRegion(UUID regionID)
327 {
328 foreach (KeyValuePair<UUID, SimpleRegionInfo> kvp in m_knownRegions)
329 {
330 if (kvp.Value.RegionID == regionID)
331 {
332 m_knownRegions.Remove(kvp.Key);
333 }
334 }
335 m_HyperlinkHandles.Remove(regionID);
336 }
302 337
303 } 338 }
304} 339}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b631478..d4d5ccc 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7838,8 +7838,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7838 public LSL_String llGetHTTPHeader(LSL_Key request_id, string header) 7838 public LSL_String llGetHTTPHeader(LSL_Key request_id, string header)
7839 { 7839 {
7840 m_host.AddScriptLPS(1); 7840 m_host.AddScriptLPS(1);
7841 7841
7842 if (m_UrlModule != null) 7842 if (m_UrlModule != null)
7843 return m_UrlModule.GetHttpHeader(new UUID(request_id), header); 7843 return m_UrlModule.GetHttpHeader(new UUID(request_id), header);
7844 return String.Empty; 7844 return String.Empty;
7845 } 7845 }
@@ -9124,9 +9124,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9124 // Partial implementation: support for parameter flags needed 9124 // Partial implementation: support for parameter flags needed
9125 // see http://wiki.secondlife.com/wiki/llHTTPResponse 9125 // see http://wiki.secondlife.com/wiki/llHTTPResponse
9126 9126
9127 m_host.AddScriptLPS(1); 9127 m_host.AddScriptLPS(1);
9128 9128
9129 if (m_UrlModule != null) 9129 if (m_UrlModule != null)
9130 m_UrlModule.HttpResponse(new UUID(id), status,body); 9130 m_UrlModule.HttpResponse(new UUID(id), status,body);
9131 } 9131 }
9132 9132