Prevent an object disposed exception that made forms comms unreliable. After

starting an asynchronous write, one should not close the channel it will
be written to synchrnously, that leads to grief.
avinationmerge
Melanie Thielker 2010-08-25 23:34:39 +02:00
parent dc1baf8025
commit 1096f43f0d
1 changed files with 7 additions and 2 deletions

View File

@ -85,8 +85,13 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
finally finally
{ {
if (requestStream != null) // If this is closed, it will be disposed internally,
requestStream.Close(); // but the above write is asynchronous and may hit after
// we're through here. So the thread handling that will
// throw and put us back into the catch above. Isn't
// .NET great?
//if (requestStream != null)
// requestStream.Close();
// Let's not close this // Let's not close this
//buffer.Close(); //buffer.Close();