Fixed offline IM

master-beforevarregion
Oren Hurvitz 2014-01-09 18:34:10 +02:00 committed by Justin Clark-Casey (justincc)
parent e99a7d879e
commit 21bc799a17
1 changed files with 4 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -100,7 +100,7 @@ namespace OpenSim.OfflineIM
return false; return false;
} }
string imXml = string.Empty; string imXml;
using (MemoryStream mstream = new MemoryStream()) using (MemoryStream mstream = new MemoryStream())
{ {
XmlWriterSettings settings = new XmlWriterSettings(); XmlWriterSettings settings = new XmlWriterSettings();
@ -110,13 +110,9 @@ namespace OpenSim.OfflineIM
{ {
m_serializer.Serialize(writer, im); m_serializer.Serialize(writer, im);
writer.Flush(); writer.Flush();
mstream.Position = 0;
using (StreamReader sreader = new StreamReader(mstream))
{
imXml = sreader.ReadToEnd();
}
} }
imXml = Util.UTF8.GetString(mstream.ToArray());
} }
OfflineIMData data = new OfflineIMData(); OfflineIMData data = new OfflineIMData();