From cacae064071bfa72766a0d4aa13ec5b796242693 Mon Sep 17 00:00:00 2001 From: "zangetsu.oe" <> Date: Sat, 4 Mar 2023 17:10:56 -0500 Subject: [PATCH 1/4] Do no replace the DefaultTexture with Null when data(UUID) is invalid. --- LibreMetaverse/Primitives/TextureEntry.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/LibreMetaverse/Primitives/TextureEntry.cs b/LibreMetaverse/Primitives/TextureEntry.cs index 5359703b..c9f9323f 100644 --- a/LibreMetaverse/Primitives/TextureEntry.cs +++ b/LibreMetaverse/Primitives/TextureEntry.cs @@ -25,6 +25,7 @@ */ using System; +using System.Diagnostics; using System.IO; using System.Linq; using OpenMetaverse.StructuredData; @@ -768,16 +769,11 @@ public static TextureEntry FromOSD(OSD osd) private void FromBytes(byte[] data, int pos, int length) { + DefaultTexture = new TextureEntryFace(null); + if (length < 16) - { // No TextureEntry to process - DefaultTexture = null; return; - } - else - { - DefaultTexture = new TextureEntryFace(null); - } uint bitfieldSize = 0; uint faceBits = 0; From 72c16209ae5c6fab31fb6e69a7c6e6b8b82ad4b1 Mon Sep 17 00:00:00 2001 From: "zangetsu.oe" <> Date: Sat, 4 Mar 2023 20:31:44 -0500 Subject: [PATCH 2/4] Disable Setting of the MaxConnectionsPerServer on the HttpClientHandler. This property is not supported on all OS's platforms (Unity/Mono?) doesn't like it. --- LibreMetaverse/GridClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibreMetaverse/GridClient.cs b/LibreMetaverse/GridClient.cs index b7c83e10..42ce1056 100644 --- a/LibreMetaverse/GridClient.cs +++ b/LibreMetaverse/GridClient.cs @@ -145,7 +145,7 @@ private HttpCapsClient SetupHttpCapsClient() { AllowAutoRedirect = true, AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip, - MaxConnectionsPerServer = Settings.MAX_HTTP_CONNECTIONS, + //MaxConnectionsPerServer = Settings.MAX_HTTP_CONNECTIONS, ServerCertificateCustomValidationCallback = (message, cert, chain, sslPolicyErrors) => { if (sslPolicyErrors == SslPolicyErrors.None) From 95457c151503fb6d4bbb6d3275e3023f93a5334a Mon Sep 17 00:00:00 2001 From: "zangetsu.oe" <> Date: Sat, 11 Mar 2023 14:54:06 -0500 Subject: [PATCH 3/4] Only skip setting MaxConnectionsPerServer when runtime is Mono --- LibreMetaverse/GridClient.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/LibreMetaverse/GridClient.cs b/LibreMetaverse/GridClient.cs index 34c6b242..28b14ad2 100644 --- a/LibreMetaverse/GridClient.cs +++ b/LibreMetaverse/GridClient.cs @@ -156,12 +156,10 @@ private HttpCapsClient SetupHttpCapsClient() return true; } }; -#if NETSTANDARD2_1_OR_GREATER || NET48_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#if NET_4_6 // a unity preproc def, not to be confused with NET46 from MS! + if (Utils.GetRunningRuntime() != Utils.Runtime.Mono) -#endif handler.MaxConnectionsPerServer = Settings.MAX_HTTP_CONNECTIONS; -#endif + HttpCapsClient client = new HttpCapsClient(handler); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Add("User-Agent", $"{Settings.USER_AGENT}"); From 428179a4527032627b12ddf6fdf8031fa68d4efd Mon Sep 17 00:00:00 2001 From: "zangetsu.oe" <> Date: Sat, 11 Mar 2023 14:57:29 -0500 Subject: [PATCH 4/4] Cleanup Usings --- LibreMetaverse/Primitives/TextureEntry.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/LibreMetaverse/Primitives/TextureEntry.cs b/LibreMetaverse/Primitives/TextureEntry.cs index c9f9323f..3cf9f514 100644 --- a/LibreMetaverse/Primitives/TextureEntry.cs +++ b/LibreMetaverse/Primitives/TextureEntry.cs @@ -25,7 +25,6 @@ */ using System; -using System.Diagnostics; using System.IO; using System.Linq; using OpenMetaverse.StructuredData;