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.

bulletsim
Diva Canto 2011-05-11 10:21:42 -07:00
parent 47735468d2
commit 5548f83750
1 changed files with 19 additions and 2 deletions

View File

@ -461,15 +461,32 @@ namespace OpenSim.Server.Handlers.Simulation
Stream inputStream; Stream inputStream;
if (httpRequest.ContentType == "application/x-gzip") if (httpRequest.ContentType == "application/x-gzip")
{
m_log.DebugFormat("[XXX]: Update called with application/x-gzip");
inputStream = new GZipStream(request, CompressionMode.Decompress); inputStream = new GZipStream(request, CompressionMode.Decompress);
}
else else
inputStream = request; inputStream = request;
Encoding encoding = Encoding.UTF8; Encoding encoding = Encoding.UTF8;
StreamReader reader = new StreamReader(inputStream, encoding); StreamReader reader = new StreamReader(inputStream, encoding);
try
{
string requestBody = reader.ReadToEnd(); string requestBody = reader.ReadToEnd();
m_log.DebugFormat("[XXX] body {0}", requestBody);
keysvals.Add("body", 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.StatusCode = 200;
httpResponse.ContentType = "text/html"; httpResponse.ContentType = "text/html";