diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 16 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 12 |
5 files changed, 30 insertions, 18 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index f71ee86..2390118 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -143,7 +143,6 @@ namespace OpenSim.Framework | |||
143 | public string RemotingAddress; | 143 | public string RemotingAddress; |
144 | public UUID ScopeID = UUID.Zero; | 144 | public UUID ScopeID = UUID.Zero; |
145 | private UUID m_maptileStaticUUID = UUID.Zero; | 145 | private UUID m_maptileStaticUUID = UUID.Zero; |
146 | public string m_maptileStaticFile; | ||
147 | 146 | ||
148 | public uint WorldLocX = 0; | 147 | public uint WorldLocX = 0; |
149 | public uint WorldLocY = 0; | 148 | public uint WorldLocY = 0; |
@@ -351,10 +350,7 @@ namespace OpenSim.Framework | |||
351 | get { return m_maptileStaticUUID; } | 350 | get { return m_maptileStaticUUID; } |
352 | } | 351 | } |
353 | 352 | ||
354 | public string MaptileStaticFile | 353 | public string MaptileStaticFile { get; private set; } |
355 | { | ||
356 | get { return m_maptileStaticFile; } | ||
357 | } | ||
358 | 354 | ||
359 | /// <summary> | 355 | /// <summary> |
360 | /// The port by which http communication occurs with the region (most noticeably, CAPS communication) | 356 | /// The port by which http communication occurs with the region (most noticeably, CAPS communication) |
@@ -723,7 +719,7 @@ namespace OpenSim.Framework | |||
723 | config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); | 719 | config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); |
724 | } | 720 | } |
725 | 721 | ||
726 | m_maptileStaticFile = config.GetString("MaptileStaticFile", String.Empty); | 722 | MaptileStaticFile = config.GetString("MaptileStaticFile", String.Empty); |
727 | allKeys.Remove("MaptileStaticFile"); | 723 | allKeys.Remove("MaptileStaticFile"); |
728 | 724 | ||
729 | #endregion | 725 | #endregion |
@@ -853,8 +849,8 @@ namespace OpenSim.Framework | |||
853 | if (m_maptileStaticUUID != UUID.Zero) | 849 | if (m_maptileStaticUUID != UUID.Zero) |
854 | config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); | 850 | config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); |
855 | 851 | ||
856 | if (m_maptileStaticFile != String.Empty) | 852 | if (MaptileStaticFile != String.Empty) |
857 | config.Set("MaptileStaticFile", m_maptileStaticFile); | 853 | config.Set("MaptileStaticFile", MaptileStaticFile); |
858 | } | 854 | } |
859 | 855 | ||
860 | public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result) | 856 | public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result) |
@@ -966,7 +962,7 @@ namespace OpenSim.Framework | |||
966 | "UUID of a texture to use as the map for this region", m_maptileStaticUUID.ToString(), true); | 962 | "UUID of a texture to use as the map for this region", m_maptileStaticUUID.ToString(), true); |
967 | 963 | ||
968 | configMember.addConfigurationOption("region_static_mapfile", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | 964 | configMember.addConfigurationOption("region_static_mapfile", ConfigurationOption.ConfigurationTypes.TYPE_STRING, |
969 | "Filename of a texture to use as the map for this region", m_maptileStaticFile, true); | 965 | "Filename of a texture to use as the map for this region", MaptileStaticFile, true); |
970 | } | 966 | } |
971 | 967 | ||
972 | public void loadConfigurationOptions() | 968 | public void loadConfigurationOptions() |
@@ -1116,7 +1112,7 @@ namespace OpenSim.Framework | |||
1116 | m_maptileStaticUUID = (UUID)configuration_result; | 1112 | m_maptileStaticUUID = (UUID)configuration_result; |
1117 | break; | 1113 | break; |
1118 | case "region_static_mapfile": | 1114 | case "region_static_mapfile": |
1119 | m_maptileStaticFile = (string)configuration_result; | 1115 | MaptileStaticFile = (string)configuration_result; |
1120 | break; | 1116 | break; |
1121 | } | 1117 | } |
1122 | 1118 | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index ea7f195..28324a5 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -833,7 +833,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
833 | 833 | ||
834 | Stream inputStream = Util.Copy(request.InputStream); | 834 | Stream inputStream = Util.Copy(request.InputStream); |
835 | 835 | ||
836 | if (request.ContentType == "application/x-gzip") | 836 | if ((request.Headers["Content-Encoding"] == "gzip") || (request.Headers["X-Content-Encoding"] == "gzip")) |
837 | inputStream = new GZipStream(inputStream, System.IO.Compression.CompressionMode.Decompress); | 837 | inputStream = new GZipStream(inputStream, System.IO.Compression.CompressionMode.Decompress); |
838 | 838 | ||
839 | using (StreamReader reader = new StreamReader(inputStream, Encoding.UTF8)) | 839 | using (StreamReader reader = new StreamReader(inputStream, Encoding.UTF8)) |
@@ -978,6 +978,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
978 | { | 978 | { |
979 | Stream requestStream = request.InputStream; | 979 | Stream requestStream = request.InputStream; |
980 | 980 | ||
981 | if ((request.Headers["Content-Encoding"] == "gzip") || (request.Headers["X-Content-Encoding"] == "gzip")) | ||
982 | requestStream = new GZipStream(requestStream, System.IO.Compression.CompressionMode.Decompress); | ||
983 | |||
981 | Encoding encoding = Encoding.UTF8; | 984 | Encoding encoding = Encoding.UTF8; |
982 | StreamReader reader = new StreamReader(requestStream, encoding); | 985 | StreamReader reader = new StreamReader(requestStream, encoding); |
983 | 986 | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs index 3171759..05ec6dc 100644 --- a/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/OSHttpRequest.cs | |||
@@ -182,11 +182,22 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
182 | _context = context; | 182 | _context = context; |
183 | 183 | ||
184 | if (null != req.Headers["content-encoding"]) | 184 | if (null != req.Headers["content-encoding"]) |
185 | _contentEncoding = Encoding.GetEncoding(_request.Headers["content-encoding"]); | 185 | { |
186 | try | ||
187 | { | ||
188 | _contentEncoding = Encoding.GetEncoding(_request.Headers["content-encoding"]); | ||
189 | } | ||
190 | catch (Exception) | ||
191 | { | ||
192 | // ignore | ||
193 | } | ||
194 | } | ||
195 | |||
186 | if (null != req.Headers["content-type"]) | 196 | if (null != req.Headers["content-type"]) |
187 | _contentType = _request.Headers["content-type"]; | 197 | _contentType = _request.Headers["content-type"]; |
188 | if (null != req.Headers["user-agent"]) | 198 | if (null != req.Headers["user-agent"]) |
189 | _userAgent = req.Headers["user-agent"]; | 199 | _userAgent = req.Headers["user-agent"]; |
200 | |||
190 | if (null != req.Headers["remote_addr"]) | 201 | if (null != req.Headers["remote_addr"]) |
191 | { | 202 | { |
192 | try | 203 | try |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index ce4af8b..c7a7341 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2031,7 +2031,7 @@ namespace OpenSim.Framework | |||
2031 | // Maps (ThreadFunc number -> Thread) | 2031 | // Maps (ThreadFunc number -> Thread) |
2032 | private static ConcurrentDictionary<long, ThreadInfo> activeThreads = new ConcurrentDictionary<long, ThreadInfo>(); | 2032 | private static ConcurrentDictionary<long, ThreadInfo> activeThreads = new ConcurrentDictionary<long, ThreadInfo>(); |
2033 | 2033 | ||
2034 | private static readonly int THREAD_TIMEOUT = 60 * 1000; | 2034 | private static readonly int THREAD_TIMEOUT = 10 * 60 * 1000; // 10 minutes |
2035 | 2035 | ||
2036 | /// <summary> | 2036 | /// <summary> |
2037 | /// Finds threads in the main thread pool that have timed-out, and aborts them. | 2037 | /// Finds threads in the main thread pool that have timed-out, and aborts them. |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 10a2560..89181a9 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -250,9 +250,12 @@ namespace OpenSim.Framework | |||
250 | 250 | ||
251 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); | 251 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); |
252 | 252 | ||
253 | request.ContentType = "application/json"; | ||
254 | |||
253 | if (compressed) | 255 | if (compressed) |
254 | { | 256 | { |
255 | request.ContentType = "application/x-gzip"; | 257 | request.Headers["X-Content-Encoding"] = "gzip"; // can't set "Content-Encoding" because old OpenSims fail if they get an unrecognized Content-Encoding |
258 | |||
256 | using (MemoryStream ms = new MemoryStream()) | 259 | using (MemoryStream ms = new MemoryStream()) |
257 | { | 260 | { |
258 | using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress)) | 261 | using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress)) |
@@ -270,10 +273,9 @@ namespace OpenSim.Framework | |||
270 | } | 273 | } |
271 | else | 274 | else |
272 | { | 275 | { |
273 | request.ContentType = "application/json"; | ||
274 | request.ContentLength = buffer.Length; //Count bytes to send | 276 | request.ContentLength = buffer.Length; //Count bytes to send |
275 | using (Stream requestStream = request.GetRequestStream()) | 277 | using (Stream requestStream = request.GetRequestStream()) |
276 | requestStream.Write(buffer, 0, buffer.Length); //Send it | 278 | requestStream.Write(buffer, 0, buffer.Length); //Send it |
277 | } | 279 | } |
278 | } | 280 | } |
279 | 281 | ||
@@ -1024,7 +1026,7 @@ namespace OpenSim.Framework | |||
1024 | } | 1026 | } |
1025 | catch (Exception e) | 1027 | catch (Exception e) |
1026 | { | 1028 | { |
1027 | m_log.ErrorFormat("[FORMS]: Error sending request to {0}: {1}. Request: {2}", requestUrl, e.Message, | 1029 | m_log.InfoFormat("[FORMS]: Error sending request to {0}: {1}. Request: {2}", requestUrl, e.Message, |
1028 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); | 1030 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); |
1029 | throw e; | 1031 | throw e; |
1030 | } | 1032 | } |
@@ -1052,7 +1054,7 @@ namespace OpenSim.Framework | |||
1052 | } | 1054 | } |
1053 | catch (Exception e) | 1055 | catch (Exception e) |
1054 | { | 1056 | { |
1055 | m_log.ErrorFormat("[FORMS]: Error receiving response from {0}: {1}. Request: {2}", requestUrl, e.Message, | 1057 | m_log.InfoFormat("[FORMS]: Error receiving response from {0}: {1}. Request: {2}", requestUrl, e.Message, |
1056 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); | 1058 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); |
1057 | throw e; | 1059 | throw e; |
1058 | } | 1060 | } |