aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Grid
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Server/Handlers/Grid
parentAdd a build script. (diff)
downloadopensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs10
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs20
-rw-r--r--OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs11
4 files changed, 24 insertions, 19 deletions
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
index 346af32..2aec045 100644
--- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
+++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
@@ -83,10 +83,10 @@ namespace OpenSim.Server.Handlers.Grid
83 { 83 {
84 _info["login"] 84 _info["login"]
85 = String.Format( 85 = String.Format(
86 "http://127.0.0.1:{0}/", 86 "http://127.0.0.1:{0}/",
87 netCfg.GetString( 87 netCfg.GetString(
88 "http_listener_port", ConfigSettings.DefaultRegionHttpPort.ToString())); 88 "http_listener_port", ConfigSettings.DefaultRegionHttpPort.ToString()));
89 89
90 IssueWarning(); 90 IssueWarning();
91 } 91 }
92 else 92 else
@@ -99,7 +99,7 @@ namespace OpenSim.Server.Handlers.Grid
99 { 99 {
100 _log.Warn("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults"); 100 _log.Warn("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults");
101 } 101 }
102 102
103 _log.DebugFormat("[GRID INFO SERVICE]: Grid info service initialized with {0} keys", _info.Count); 103 _log.DebugFormat("[GRID INFO SERVICE]: Grid info service initialized with {0} keys", _info.Count);
104 } 104 }
105 105
@@ -107,7 +107,7 @@ namespace OpenSim.Server.Handlers.Grid
107 { 107 {
108 _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your configuration files"); 108 _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your configuration files");
109 _log.Warn("[GRID INFO SERVICE]: trying to guess sensible defaults, you might want to provide better ones:"); 109 _log.Warn("[GRID INFO SERVICE]: trying to guess sensible defaults, you might want to provide better ones:");
110 110
111 foreach (string k in _info.Keys) 111 foreach (string k in _info.Keys)
112 { 112 {
113 _log.WarnFormat("[GRID INFO SERVICE]: {0}: {1}", k, _info[k]); 113 _log.WarnFormat("[GRID INFO SERVICE]: {0}: {1}", k, _info[k]);
@@ -181,7 +181,7 @@ namespace OpenSim.Server.Handlers.Grid
181 new string[] { "Startup", "Hypergrid" }, String.Empty); 181 new string[] { "Startup", "Hypergrid" }, String.Empty);
182 182
183 if (!String.IsNullOrEmpty(HomeURI)) 183 if (!String.IsNullOrEmpty(HomeURI))
184 map["home"] = OSD.FromString(HomeURI); 184 map["home"] = OSD.FromString(HomeURI);
185 else // Legacy. Remove soon! 185 else // Legacy. Remove soon!
186 { 186 {
187 IConfig cfg = m_Config.Configs["LoginService"]; 187 IConfig cfg = m_Config.Configs["LoginService"];
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index 86fda36..44d4654 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -65,9 +65,9 @@ namespace OpenSim.Server.Handlers.Grid
65 protected override byte[] ProcessRequest(string path, Stream requestData, 65 protected override byte[] ProcessRequest(string path, Stream requestData,
66 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 66 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
67 { 67 {
68 StreamReader sr = new StreamReader(requestData); 68 string body;
69 string body = sr.ReadToEnd(); 69 using(StreamReader sr = new StreamReader(requestData))
70 sr.Close(); 70 body = sr.ReadToEnd();
71 body = body.Trim(); 71 body = body.Trim();
72 72
73 //m_log.DebugFormat("[XXX]: query String: {0}", body); 73 //m_log.DebugFormat("[XXX]: query String: {0}", body);
@@ -126,7 +126,7 @@ namespace OpenSim.Server.Handlers.Grid
126 case "get_grid_extra_features": 126 case "get_grid_extra_features":
127 return GetGridExtraFeatures(request); 127 return GetGridExtraFeatures(request);
128 } 128 }
129 129
130 m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method); 130 m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method);
131 } 131 }
132 catch (Exception e) 132 catch (Exception e)
@@ -579,33 +579,33 @@ namespace OpenSim.Server.Handlers.Grid
579 if (request.ContainsKey("SCOPEID")) 579 if (request.ContainsKey("SCOPEID"))
580 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); 580 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
581 else 581 else
582 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); 582 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get RegionFlags");
583 583
584 UUID regionID = UUID.Zero; 584 UUID regionID = UUID.Zero;
585 if (request.ContainsKey("REGIONID")) 585 if (request.ContainsKey("REGIONID"))
586 UUID.TryParse(request["REGIONID"].ToString(), out regionID); 586 UUID.TryParse(request["REGIONID"].ToString(), out regionID);
587 else 587 else
588 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); 588 m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get RegionFlags");
589 589
590 int flags = m_GridService.GetRegionFlags(scopeID, regionID); 590 int flags = m_GridService.GetRegionFlags(scopeID, regionID);
591 // m_log.DebugFormat("[GRID HANDLER]: flags for region {0}: {1}", regionID, flags); 591 // m_log.DebugFormat("[GRID HANDLER]: flags for region {0}: {1}", regionID, flags);
592 592
593 Dictionary<string, object> result = new Dictionary<string, object>(); 593 Dictionary<string, object> result = new Dictionary<string, object>();
594 result["result"] = flags.ToString(); 594 result["result"] = flags.ToString();
595 595
596 string xmlString = ServerUtils.BuildXmlResponse(result); 596 string xmlString = ServerUtils.BuildXmlResponse(result);
597 597
598 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); 598 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
599 return Util.UTF8NoBomEncoding.GetBytes(xmlString); 599 return Util.UTF8NoBomEncoding.GetBytes(xmlString);
600 } 600 }
601 601
602 byte[] GetGridExtraFeatures(Dictionary<string, object> request) 602 byte[] GetGridExtraFeatures(Dictionary<string, object> request)
603 { 603 {
604 604
605 Dictionary<string, object> result = new Dictionary<string, object> (); 605 Dictionary<string, object> result = new Dictionary<string, object> ();
606 Dictionary<string, object> extraFeatures = m_GridService.GetExtraFeatures (); 606 Dictionary<string, object> extraFeatures = m_GridService.GetExtraFeatures ();
607 607
608 foreach (string key in extraFeatures.Keys) 608 foreach (string key in extraFeatures.Keys)
609 { 609 {
610 result [key] = extraFeatures [key]; 610 result [key] = extraFeatures [key];
611 } 611 }
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs
index 1e29378..755272b 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerConnector.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.GridUser
56 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
57 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(service, args); 57 m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(service, args);
58 58
59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName); ; 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
60 60
61 server.AddStreamHandler(new GridUserServerPostHandler(m_GridUserService, auth)); 61 server.AddStreamHandler(new GridUserServerPostHandler(m_GridUserService, auth));
62 } 62 }
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
index 9237c63..1f691d6 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
@@ -60,9 +60,9 @@ namespace OpenSim.Server.Handlers.GridUser
60 protected override byte[] ProcessRequest(string path, Stream requestData, 60 protected override byte[] ProcessRequest(string path, Stream requestData,
61 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 61 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
62 { 62 {
63 StreamReader sr = new StreamReader(requestData); 63 string body;
64 string body = sr.ReadToEnd(); 64 using(StreamReader sr = new StreamReader(requestData))
65 sr.Close(); 65 body = sr.ReadToEnd();
66 body = body.Trim(); 66 body = body.Trim();
67 67
68 //m_log.DebugFormat("[XXX]: query String: {0}", body); 68 //m_log.DebugFormat("[XXX]: query String: {0}", body);
@@ -185,6 +185,9 @@ namespace OpenSim.Server.Handlers.GridUser
185 185
186 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(user); 186 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(user);
187 187
188 if (guinfo == null)
189 return FailureResult();
190
188 Dictionary<string, object> result = new Dictionary<string, object>(); 191 Dictionary<string, object> result = new Dictionary<string, object>();
189 if (guinfo != null) 192 if (guinfo != null)
190 result["result"] = guinfo.ToKeyValuePairs(); 193 result["result"] = guinfo.ToKeyValuePairs();
@@ -225,6 +228,8 @@ namespace OpenSim.Server.Handlers.GridUser
225 int i = 0; 228 int i = 0;
226 foreach (GridUserInfo pinfo in pinfos) 229 foreach (GridUserInfo pinfo in pinfos)
227 { 230 {
231 if(pinfo == null)
232 continue;
228 Dictionary<string, object> rinfoDict = pinfo.ToKeyValuePairs(); 233 Dictionary<string, object> rinfoDict = pinfo.ToKeyValuePairs();
229 result["griduser" + i] = rinfoDict; 234 result["griduser" + i] = rinfoDict;
230 i++; 235 i++;