From 5548f837501184d68c352097ad1a1de566e18ca0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 10:21:42 -0700 Subject: Functional improvement: close the stream. Non-functional: add debug messages to find out why updates are getting an error. WARNING: MASSIVE CONSOLE SPAM ON TPs. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'OpenSim/Server/Handlers') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 379924f..f938e4b 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -461,15 +461,32 @@ namespace OpenSim.Server.Handlers.Simulation Stream inputStream; if (httpRequest.ContentType == "application/x-gzip") + { + m_log.DebugFormat("[XXX]: Update called with application/x-gzip"); inputStream = new GZipStream(request, CompressionMode.Decompress); + } else inputStream = request; Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); - string requestBody = reader.ReadToEnd(); - keysvals.Add("body", requestBody); + try + { + string requestBody = reader.ReadToEnd(); + m_log.DebugFormat("[XXX] body {0}", requestBody); + keysvals.Add("body", requestBody); + } + catch (Exception e) + { + m_log.DebugFormat("[AGENT HANDLER]: Exception readin gzip stream: {0}", e); + httpResponse.StatusCode = (int)HttpStatusCode.BadRequest; + return new byte[0]; + } + finally + { + reader.Close(); + } httpResponse.StatusCode = 200; httpResponse.ContentType = "text/html"; -- cgit v1.1 From af2e12d2b4fda54ec028c030c1fe5a87d1950251 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 10:43:50 -0700 Subject: One more debug message. Don't use this unless your name is nebadon. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Server/Handlers') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index f938e4b..46b511d 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -466,7 +466,10 @@ namespace OpenSim.Server.Handlers.Simulation inputStream = new GZipStream(request, CompressionMode.Decompress); } else + { + m_log.DebugFormat("[XXX]: Update called with {0}", httpRequest.ContentType); inputStream = request; + } Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); -- cgit v1.1 From 7fa2489a6e2391205b17cde24cdb4cab1accc8bd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 13:15:27 -0700 Subject: Revert "Functional improvement: close the stream. Non-functional: add debug messages to find out why updates are getting an error. WARNING: MASSIVE CONSOLE SPAM ON TPs." This reverts commit 5548f837501184d68c352097ad1a1de566e18ca0. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'OpenSim/Server/Handlers') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 46b511d..ad74b9b 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -461,10 +461,7 @@ namespace OpenSim.Server.Handlers.Simulation Stream inputStream; if (httpRequest.ContentType == "application/x-gzip") - { - m_log.DebugFormat("[XXX]: Update called with application/x-gzip"); inputStream = new GZipStream(request, CompressionMode.Decompress); - } else { m_log.DebugFormat("[XXX]: Update called with {0}", httpRequest.ContentType); @@ -474,22 +471,8 @@ namespace OpenSim.Server.Handlers.Simulation Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); - try - { - string requestBody = reader.ReadToEnd(); - m_log.DebugFormat("[XXX] body {0}", requestBody); - keysvals.Add("body", requestBody); - } - catch (Exception e) - { - m_log.DebugFormat("[AGENT HANDLER]: Exception readin gzip stream: {0}", e); - httpResponse.StatusCode = (int)HttpStatusCode.BadRequest; - return new byte[0]; - } - finally - { - reader.Close(); - } + string requestBody = reader.ReadToEnd(); + keysvals.Add("body", requestBody); httpResponse.StatusCode = 200; httpResponse.ContentType = "text/html"; -- cgit v1.1 From e9e4c009b470056dce05cae386860494b0734678 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 May 2011 20:44:03 -0700 Subject: This makes compression of fatpacks actually work. Previously they always failed. See comment in WebUtil. --- OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Server/Handlers') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index ad74b9b..e8ae05b 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -283,6 +283,7 @@ namespace OpenSim.Server.Handlers.Simulation StreamReader reader = new StreamReader(inputStream, encoding); string requestBody = reader.ReadToEnd(); + reader.Close(); keysvals.Add("body", requestBody); httpResponse.StatusCode = 200; @@ -463,15 +464,13 @@ namespace OpenSim.Server.Handlers.Simulation if (httpRequest.ContentType == "application/x-gzip") inputStream = new GZipStream(request, CompressionMode.Decompress); else - { - m_log.DebugFormat("[XXX]: Update called with {0}", httpRequest.ContentType); inputStream = request; - } Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(inputStream, encoding); string requestBody = reader.ReadToEnd(); + reader.Close(); keysvals.Add("body", requestBody); httpResponse.StatusCode = 200; -- cgit v1.1